Apoccalypse
New Member
- Joined
- Apr 15, 2017
- Messages
- 114
- Solutions
- 2
- Reaction score
- 4
Hello guys,
I am trying to make the specific item to increase all damage dealt.
I have the following script:
I use the storage ,because I was getting a stack overflow all over again.
The storage is set in movements:
The problem is that I get no errors but the script is no working for me.
If anyone would help that would be great
I am trying to make the specific item to increase all damage dealt.
I have the following script:
Lua:
function onStatsChange(cid, attacker, type, combat, value)
local config = {
item_id = 2400, -- right or left hand
more_dmg = 30, -- percent
more_dmg_spell = 20, -- percent
storage = 815869
}
if isPlayer(cid) and getPlayerStorageValue(cid, 815869) == 1 then
if((type == STATSCHANGE_HEALTHLOSS or STATSCHANGE_MANALOSS) and (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == config.item_id or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == config.item_id)) then
if(combat == COMBAT_PHYSICALDAMAGE) then
local correct = value + (value * config.more_dmg)
doTargetCombatHealth(attacker, cid, combat, correct, correct, 255)
else
local correct = value + (value * config.more_dmg_spell)
doTargetCombatHealth(attacker, cid, combat, correct, correct, 255)
end
return false
end
end
end
Lua:
registerCreatureEvent(cid, "MoreDMG")
Lua:
<event type="statschange" name="MoreDMG" event="script" value="MoreDMG.lua"/>
I use the storage ,because I was getting a stack overflow all over again.
The storage is set in movements:
Lua:
function onEquip(cid, item, slot)
local slots = getPlayerSlotItem(cid, slot)
if slots then
if slots.itemid ~= item.itemid then
return true
end
if getPlayerStorageValue(cid, 815869) < 1 then
setPlayerStorageValue(cid, 815869, 1)
end
end
return true
end
function onDeEquip(cid, item, slot)
if getPlayerStorageValue(cid, 815869) > 0 then
setPlayerStorageValue(cid, 815869, 0)
end
return true
end
The problem is that I get no errors but the script is no working for me.
If anyone would help that would be great