_Aion_
Nothing Else
Hello.
I'm tring to make on creatureevent that player kill boss and win reward.
script work fine, but i have one question,
how i put for only one player or 2 players win reward?
what is difference function onKill(cid, target, damage, flags,war) for function onKill(cid, target, lastHit)
I'm using OTX 2.x for 8.60
Here my script
I'm tring to make on creatureevent that player kill boss and win reward.
script work fine, but i have one question,
how i put for only one player or 2 players win reward?
what is difference function onKill(cid, target, damage, flags,war) for function onKill(cid, target, lastHit)
I'm using OTX 2.x for 8.60
Here my script
Lua:
function onKill(cid, target, lastHit)
--function onKill(cid, target, damage, flags,war)
if isPlayer(cid) and isMonster(target) then
local monster = config[getCreatureName(target)]
if monster then
local bag = doCreateItemEx(monster.BagId, 1)
for i = 1,#monster.loot do
if monster.loot[i][2] >= math.random(1,100) then
local item = doAddContainerItem(bag, monster.loot[i][1],monster.loot[i][3])
if (monster.use_stats) then
for z = 1,#monster.chance_attr do
if(monster.chance_attr[z][2] >= math.random(1,100) and ItemInfo(monster.chance_attr[z][4], monster.loot[i][1]))then
doItemSetAttribute(item, monster.chance_attr[z][1], math.random(monster.chance_attr[z][3][1],monster.chance_attr[z][3][2]))
end
end
end
end
end
if(getContainerItem(bag, 0).uid > 0)then
doSendMagicEffect(getThingPos(cid), monster.effect)
doSendAnimatedText(getThingPos(cid), monster.animatedText[2],monster.animatedText[1])
if monster.SendToDepot then
doPlayerSendMailByName(getCreatureName(cid), bag, getPlayerTown(cid), "Admin")
else
doPlayerAddItemEx(cid, bag,true)
doAddVipDays(cid, monster.vipDays)
setPK(cid, monster.Pk)
addPontos(cid, monster.Events)
setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+monster.Mana))
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+monster.Health))
doBroadcastMessage("O ".. getCreatureName(cid) .. " derrotou o ".. monster.Name .. " e recebeu a recompensa.")
doPlayerSendTextMessage(cid, 18, "You received ".. monster.vipDays .." VIP Days, ".. monster.Events .." Events Points, ".. monster.Pk .." Pk Points, ".. monster.Mana .." Mana and ".. monster.Health .." Health.")
end
doPlayerSendTextMessage(cid, 25, monster.message)
else
doPlayerSendTextMessage(cid, 25, "Better Luck Next Time,You Got No Reward.")
end
end
end
return true
end