Advertisement
Uissu

[X-TIBIA][ACTION] Simple Safira Pet

Feb 4th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | None | 0 0
  1. function doPlayerHaveSafira(cid)
  2.         for _,summon in pairs(getCreatureSummons(cid)) do
  3.                 if getCreatureName(summon) == "Safira" then
  4.                         return true
  5.                         break
  6.                 end
  7.         end
  8. return false
  9. end
  10.  
  11. function onUse(cid, item, pos, item2, topos)
  12.         if doPlayerHaveSafira(cid) then
  13.                 for _,summon in pairs(getCreatureSummons(cid)) do
  14.                         if getCreatureName(summon) == "Safira" then
  15.                                 doSendMagicEffect(getThingPos(summon), 11)
  16.                                 doRemoveCreature(summon)
  17.                         end
  18.                 end
  19.                 doCreatureSay(cid, 'Back, Safira!')
  20.         else
  21.                 local safira = doCreateMonster("Safira", getThingPos(cid))
  22.                 if safira then
  23.                         doConvinceCreature(cid, safira.uid)
  24.                 end
  25.                 doCreatureSay(cid, 'Go, Safira!')
  26.         end
  27. return true
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement