demonrage
New Member
- Joined
- Oct 28, 2014
- Messages
- 22
- Reaction score
- 2
I'm using otx2 8.60
Code:
Code:
Lua:
function onUse(cid, item, frompos, item2, topos)
local dolls = {
[12179] = {pet = "[Pet] Demon"},
}
local go = dolls[item.itemid]
local summon = getCreatureSummons(cid)
local slotForUse = CONST_SLOT_AMMO
local item = getPlayerSlotItem(cid, slotForUse)
---------------------------------------------------
local ammo = getPlayerSlotItem(cid, slotForUse)
if ammo.uid ~= item.uid then
return doPlayerSendCancel(cid, "The weapon must be located in your slot ammunition.")
end
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, ""..go.pet..", Recuar!", TALKTYPE_ORANGE_1)
end
return true
end
if (getPlayerItemCount(cid, item.itemid) <= 0) then
doPlayerSendTextMessage(cid, 19, "Voce precisa do item em sua backpack ou slot toten.")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return true
end
if (getTilePzInfo(getCreaturePosition(cid))) then
doPlayerSendTextMessage(cid, 19, "Voce nao pode sumonar seu PET em Protect Zone!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return true
end
if (getPlayerStorageValue(cid, 6641) == 1 or isPlayer(cid)) then
doConvinceCreature(cid, doSummonCreature(go.pet, getCreaturePosition(cid)))
doCreatureSay(cid, ""..go.pet..", GO!", TALKTYPE_ORANGE_1)
else
doPlayerSendTextMessage(cid, 19, "Voce precisa da quest para usar esse PET!")
doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
end
return true
end