SpiderOT
™ツʂριԃҽɾσƚ➽ ٩(•‿•)۶★彡
hello all
can anyone fix this script? it is about a rune like sd but finite rune (in action not spell) everything work fine but if i hit someone1 the damage go to me
simple i hit myself xD
here is the script
i think the problem in
can anyone fix this script? it is about a rune like sd but finite rune (in action not spell) everything work fine but if i hit someone1 the damage go to me
simple i hit myself xD
here is the script
Code:
function onUse(cid, item, frompos, item2, topos)
storevalue = 1000
exhaustion = 1
smallruneid = 2307
lv = getPlayerLevel(cid)
ex = -(lv*1000)
if (item.itemid == smallruneid) then
exhast = exhaust(cid, storevalue, exhaustion)
if (exhast == 0) then
doPlayerSendCancel(cid, "You are exhausted.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are exhausted.")
else
if (item.type > 1) then
doSendMagicEffect(getPlayerPosition(cid), 29)
doChangeTypeItem(item.uid, item.type-1)
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, ex, ex, CONST_ME_NONE)
doCreatureSay(cid, "Death Coming!", TALKTYPE_ORANGE_1)
else
doSendMagicEffect(getPlayerPosition(cid), 29)
doCreatureSay(cid, "Death Coming", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, ex, ex, CONST_ME_NONE)
end
end
end
end
function exhaust(cid, storevalue, exhausttime)
newExhaust = os.time()
oldExhaust = getPlayerStorageValue(cid, storevalue)
if (oldExhaust == nil or oldExhaust < 0) then
oldExhaust = 0
end
if (exhausttime == nil or exhausttime < 0) then
exhausttime = 1
end
diffTime = os.difftime(newExhaust, oldExhaust)
if (diffTime >= exhausttime or diffTime < 0) then
setPlayerStorageValue(cid, storevalue, newExhaust)
return 1
else
return 0
end
end
Code:
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, ex, ex, CONST_ME_NONE)