Jump to content
×
×
  • Create New...
  • 0

[AJUDA] Spell rouba dinheiro


Question

Versão do Servidor: TFS - 1.0
Tipo de Script: spell
Código:
 
local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BLOCKHIT)

setCombatParam(combat, COMBAT_PARAM_USECHARGES, TRUE)

setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, -20, 0.4, -30)

 

local area = createCombatArea({ {1} })

setCombatArea(combat, area)

 

function onCastSpell(cid, var)

if isPlayer(getCreatureTarget(cid)) == 1 then

if math.random(1,100) <= 100 then

local itemX = {2148, 2152, 2160}

local itemX_rnd = itemX[math.random(1,#itemX)]

for i = 1, #itemX do

if itemX > 0 then

local metade = math.floor((getPlayerItemCount(getCreatureTarget(cid), itemX_rnd))/2)

--local metade = getPlayerItemCount(getCreatureTarget(cid), itemX_rnd)

doPlayerRemoveItem(getCreatureTarget(cid), itemX_rnd, metade)

doPlayerAddItem(cid, itemX_rnd, metade)

doSendMagicEffect(getThingPos(getCreatureTarget(cid)), 31)

doSendAnimatedText(getThingPos(getCreatureTarget(cid)), 'Steal!', 35)

end

end

end

end

return doCombat(cid, combat, var)

end

Achei essa spell por ai. Eu queria uma spell que tivesse 50% de chance de roubar metade do dinheiro de outro player. Eu tentei essa dai botei 100% de chance mas nao ta funcionando.

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now