its work like this damage +(damage*(storage*2.5)/100)@heba
Worked but now testing I think the formula isnt right because with 0 storage I deal 2800 and with 25 I deal 16k
0.4what source u use ?
Yes i saw but I need with this:[TFS 0.4] Increase Damage
Hi guys! Inspired by the topic created by @runsicky (Here) and which received support from @heba , I would like to know if it is possible to use the same logic but that instead of the player absorbing X% of the damage received, having its damage increased by X% if player has a certain storage...otland.net
Yes i saw but I need with this:
How to do for increase per amount of that storage?
Like 2.5% increase damage per value storage?
if(caster && caster->getPlayer())
{
std::string value;
caster->getStorage(170298, value);
int32_t plus = (int32_t)(atoi(value.c_str()));
int32_t power =plus *2.5 ;
if(plus > 0 && params.combatType != COMBAT_HEALING )
change = (int32_t)std::ceil (change + change * power /100);
}
this mean if player have storage+100 will get damage 250%
player damage is 500 without storage
if get storage+100
player damage will be 500+500*250/100
this work with spells and wand damage onlyLua:if(caster && caster->getPlayer()) { std::string value; caster->getStorage(170298, value); int32_t plus = (int32_t)(atoi(value.c_str())); int32_t power =plus *2.5 ; if(plus > 0 && params.combatType != COMBAT_HEALING ) change = (int32_t)std::ceil (change + change * power /100); }
How to set for both?yes but need to change
caster->getPlayer() to caster->getMonster()
caster->getCreature()How to set for both?
if(caster && caster->getPlayer())
{
std::string value;
caster->getStorage("170298", value);
int32_t plus = (int32_t)(atoi(value.c_str()));
int32_t power =plus *2.5 ;
if(plus > 0 && params.combatType != COMBAT_HEALING )
change = (int32_t)std::ceil (change + change * power /100);
}
Without errors but didnt change any damage with 1000 or 0 storageLua:if(caster && caster->getPlayer()) { std::string value; caster->getStorage("170298", value); int32_t plus = (int32_t)(atoi(value.c_str())); int32_t power =plus *2.5 ; if(plus > 0 && params.combatType != COMBAT_HEALING ) change = (int32_t)std::ceil (change + change * power /100); }
u sure add everything oki?Without errors but didnt change any damage with 1000 or 0 storage
if(caster && caster->getPlayer())
{
std::string value;
caster->getStorage("170298", value);
int32_t plus = (int32_t)(atoi(value.c_str()));
int32_t power =plus *2.5 ;
if(plus > 0 && params.combatType != COMBAT_HEALING )
change = (int32_t)std::ceil (change + change * power /100);
}
int32_t change = 0;
if(Combat2Var* var = (Combat2Var*)data)
{
change = var->change;
if(!change)
change = random_range(var->minChange, var->maxChange, DISTRO_NORMAL);
}
its work like this damage +(damage*(storage*2.5)/100)