• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Feature Vampiric weapons 0.2

yeah, write code for every weapon that will use it balancing attack values etc, or as in my case for ALL weapons, checking how big is this value
Cause I want to create fully randomized item attributes, so ANY weapon can get that attributes with almost ANY value of stealing

This way it was faster, also previous version was uber fast, but cause I found bugs after releasing I had to fix it
 
Just a suggestion:
F.ex. if you wear Vampire Shield, when someone takes damage on you, you will steal X% life and/or mana from the attacker based on the damage you recieved.
 
possible, I'll probably code sth like that
hmm, there are reflects already right? but how it work? resist+dmg to attacker or only dmg to attacker? anyone knows or I have to dig in source again? xD
 
I'm asking HOW reflect works, it seems that its reduce dmg by x% and deal that x% of that type dmg to attacker
I'd like to code also you get full dmg but attacker gets dmg also
 
it steal percent of maxhp or percent of damage done in each hit?
 
Just a suggestion:
F.ex. if you wear Vampire Shield, when someone takes damage on you, you will steal X% life and/or mana from the attacker based on the damage you recieved.

this can be made with "onStatsChange" creature event function, and can be possible made a "Drain System" with these function :)
 
Lares: youre right, I just noticed that this code made aoe deal no damage for some reason, hope that it wont take too much tim eto fix it cause I wanted to update this code a bit...

ok, fixed that one, wanted to make it more pro but it was crashing serv...

anyway, next update is coming
 
Last edited:
updated! now you can put that attributes in any eq part, if you have old version change
Code:
int lifestealpercent=item->getLifestealPercent();
        int manastealpercent=item->getManastealPercent();
to
Code:
int32_t lifestealpercent=0;
		int32_t manastealpercent=0;
		Item* item = NULL;
		for(int32_t slot = SLOT_FIRST; slot < SLOT_LAST; ++slot)
		{
			if(! player->getInventoryItem((slots_t)slot) || slot == 10) continue;
			item = player->getInventoryItem((slots_t)slot);
			const ItemType& it = Item::items[item->getID()];
			if (((slot == 5 || slot == 6) && (it.weaponType!=WEAPON_SWORD && it.weaponType!=WEAPON_CLUB &&
			it.weaponType!=WEAPON_AXE && it.weaponType!=WEAPON_DIST && it.weaponType!=WEAPON_SHIELD && it.weaponType!=WEAPON_FIST))) continue;
			lifestealpercent+=item->getLifestealPercent();
			manastealpercent+=item->getManastealPercent();
		}
in weapons.cpp
 
There is a problem, manasteal does not work.
You have to change
Code:
if(manastolen>0)
to
Code:
if(manastolen<0)


Put this
Code:
if(lifestolen<0)
    g_game.addMagicEffect(caster->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
after
Code:
Combat::doCombatHealth(caster, caster, -lifestolen, -lifestolen, lifesteal);
and
Code:
if(manastolen<0)
    g_game.addMagicEffect(caster->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
after
Code:
Combat::doCombatMana(caster, caster, -manastolen, -manastolen, manasteal);
That would be nice.
 
Last edited:
Still the same error ;/

Code:
 In static member function `static void Combat::doCombatHealth(Creature*, const Position&, const CombatArea*, int32_t, int32_t, const CombatParams&, int, int)': 
866 C:\Users\xxxxxx\xxxx\0.3.6pl1.r80 - Copy\combat.cpp [Warning] the address of `static bool Combat::CombatHealthFunc(Creature*, Creature*, const CombatParams&, void*, int, int)', will always evaluate as `true' 
[Linker error] undefined reference to `Combat::CombatFunc(Creature*, Position const&, CombatArea const*, CombatParams const&, bool (*)(Creature*, Creature*, CombatParams const&, void*), void*)' 
[Linker error] undefined reference to `Combat::CombatFunc(Creature*, Position const&, CombatArea const*, CombatParams const&, bool (*)(Creature*, Creature*, CombatParams const&, void*), void*)' 
[Linker error] undefined reference to `Combat::CombatFunc(Creature*, Position const&, CombatArea const*, CombatParams const&, bool (*)(Creature*, Creature*, CombatParams const&, void*), void*)' 
[Linker error] undefined reference to `Combat::CombatFunc(Creature*, Position const&, CombatArea const*, CombatParams const&, bool (*)(Creature*, Creature*, CombatParams const&, void*), void*)' 
C:\Users\xxxxxx\xxxx\0.3.6pl1.r80 - Copy\dev-cpp\Makefile.win [Build Error]  [TheForgottenServer.exe] Error 1
 
96551795.png

0.3.6 v5 8.6

Please help
 
Back
Top