Tormented Being
Member
Thanks for looking.
I'm trying to update this training monk script that displays your dps to tfs 1.2 Original link below:
https://otland.net/threads/interactive-training-monk.145227/#post-1396476.
What I have so far gives no errors but it make it so the monk takes no visible damage even though the weapons make contact and I get a dps reading that is accurate. It has also made it so regular players can't be attacked. Any ideas?
I'm trying to update this training monk script that displays your dps to tfs 1.2 Original link below:
https://otland.net/threads/interactive-training-monk.145227/#post-1396476.
What I have so far gives no errors but it make it so the monk takes no visible damage even though the weapons make contact and I get a dps reading that is accurate. It has also made it so regular players can't be attacked. Any ideas?
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 82936)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000)
function getDamageDone(cid, targetpos)
targetpos.x = targetpos.x - 1
if(isPlayer(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Average DPS: ".. getPlayerStorageValue(cid, 82936) / 10 .."")
doCreatureSay(cid, "You are currently dealing an average of ".. getPlayerStorageValue(cid, 82936) / 10 .." damage per second.", TALKTYPE_ORANGE_1, false, 0, targetpos)
return setPlayerStorageValue(cid, 82936, 0)
end
return true
end
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if(primaryDamage >= 0) then
if(not isPlayer(attacker.uid)) then
return true
end
setPlayerStorageValue(attacker.uid, 82936, getPlayerStorageValue(attacker.uid, 82936) + primaryDamage)
if(getCreatureCondition(attacker.uid, CONDITION_EXHAUST, 82936) == false) then
setPlayerStorageValue(attacker.uid, 82936, 0)
addEvent(getDamageDone, 9900, attacker.uid, creature:getPosition())
doAddCondition(attacker.uid, exhaust)
end
end
return true
end