Hello.
Im working for custom PvP system (for my OT) and i was looking for one function or something (I do not know what I call on it ;/)
On my Pvp system is used secureMode but all is OK (player cant attack opponent when attacker dont have secure mode on ).
Thats OK.
But i need help with onCast, support.
Now when player have SecureMode = off and cast area/wave spell the opponent dont receive damage <- That part is good, but attacker receive skull <- That part is bad.
How I can do something like this:
When attacker deal damage with area/wave spell he receive skull ?
Now its like: When attacker dont deal damage to enemy he also receive skull
Here is the script:
I declared in luascript.cpp the getPlayerSecureMode.
I need help with getting skull in onCast part of the script.
Anyone ?
Im working for custom PvP system (for my OT) and i was looking for one function or something (I do not know what I call on it ;/)
On my Pvp system is used secureMode but all is OK (player cant attack opponent when attacker dont have secure mode on ).
Thats OK.
But i need help with onCast, support.
Now when player have SecureMode = off and cast area/wave spell the opponent dont receive damage <- That part is good, but attacker receive skull <- That part is bad.
How I can do something like this:
When attacker deal damage with area/wave spell he receive skull ?
Now its like: When attacker dont deal damage to enemy he also receive skull
Here is the script:
Lua:
function onStatsChange(cid, attacker, type, combat, value)
if(attacker and isPlayer(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and getPlayerSecureMode(attacker)) then
return false
end
return true
end
function onTarget(cid, target)
if(isPlayer(target) and getCreatureTarget(cid) ~= target) then
doPlayerSendCancel(cid, "Turn secure mode off if you really want to attack unmarked players.")
return true
end
return true
end
function onCast(cid, target)
if (attacker and isPlayer(attacker) and isPlayer(target) and getCreatureTarget(cid) ~= target) then
doPlayerSendCancel(cid, "Turn secure mode off if you really want to attack unmarked players.")
return false
end
return true
end
I need help with getting skull in onCast part of the script.
Anyone ?