Ir para conteúdo

[Creaturescripts]Training Monk Interativo


Subwat

Posts Recomendados

Codigo Lua em creaturescripts

 

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 onStatsChange(cid, attacker, type, combat, value)
if(type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
if(not isPlayer(attacker)) then
return true
end

setPlayerStorageValue(attacker, 82936, getPlayerStorageValue(attacker, 82936) + value)

if(getCreatureCondition(attacker, CONDITION_EXHAUST, 82936) == false) then
setPlayerStorageValue(attacker, 82936, 0)
addEvent(getDamageDone, 9900, attacker, getCreaturePosition(cid))
doAddCondition(attacker, exhaust)
end
end
   return true
end

 

XML:

 <event type="statschange" name="DPScounter" event="script" value="dpscounter.lua"/>

 

 

Mude seu training monk para:

 

 

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Training Monk" nameDescription="a training monk" race="blood" experience="0" speed="210" manacost="0">
<health now="99000" max="99000"/>
<look type="57" corpse="3128"/>
<targetchange interval="60000" chance="0"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag staticattack="50"/>
<flag lightlevel="0"/>
<flag lightcolor="0"/>
<flag targetdistance="1"/>
<flag runonhealth="0"/>
</flags>
<script>
<event name="DPScounter"/>
</script>
<attacks>
<attack name="melee" interval="5000" min="0" max="-1"/>
</attacks>
<defenses armor="0" defense="0">
<defense name="healing" interval="10000" chance="100" min="24000" max="24000"/>
</defenses>
</monster>

 

 

 

Créditos:

Sportacus

Editado por Subwat
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...