MaXwEllDeN

Untitled

Jun 10th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.47 KB | None | 0 0
  1. --Config
  2. local storage = 99956
  3.  
  4. local area = {
  5.     {0,0,0},
  6.     {0,3,0},
  7.     {0,0,0},
  8. }
  9.  
  10. function iniNikudan(cid)
  11.     mayNotMove(cid, true)
  12.  
  13.     doSetCreatureOutfit(cid, {lookType = 427}, 500)
  14.     addEvent(doSetCreatureOutfit, 200, cid, {lookType = 428}, 500)
  15.     addEvent(doSetCreatureOutfit, 400, cid, {lookType = 429}, 500)
  16.     addEvent(mayNotMove, 500, cid, false)
  17.     addEvent(doSetCreatureOutfit, 600, cid, {lookType = 422}, -1)
  18.     addEvent(doCreatureSay, 700, cid, "Nikudan Sensha!", TALKTYPE_MONSTER)
  19. end
  20.  
  21. function nikudanSensha(cid, chakra)
  22.  
  23.     if not isCreature(cid) or getPlayerStorageValue(cid, storage) < 1 then
  24.         return false
  25.     end
  26.  
  27.     local minDmg = -(getPlayerSkill(cid, 0) * 1)
  28.     local maxDmg = -(getPlayerSkill(cid, 0) * 1.2)
  29.     local efeito = CONST_ME_NONE
  30.     local poslook = getCreatureLookPosition(cid)
  31.     poslook.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
  32.  
  33.     if isWalkable(poslook, false, false, false) then
  34.         if isCreature(getThingfromPos(poslook).uid) then
  35.             doMoveCreature(cid, getPlayerLookDirection(cid))
  36.             doAreaCombatHealth(cid, COMBAT_PHYSICALDAMAGE, getCreaturePosition(cid), area, minDmg, maxDmg, efeito)
  37.         end
  38.     end
  39.  
  40.     doPlayerAddMana(cid, chakra)
  41.     addEvent(nikudanSensha, 350, cid, chackra)
  42. end
  43.  
  44. function onUse(cid, item, frompos, item2, topos)
  45.     if(getPlayerStorageValue(cid,storage) == 0) then
  46.         iniNikudan(cid)
  47.         setPlayerStorageValue(cid, storage, 1)
  48.         addEvent(nikudanSensha, 800, cid, -3)
  49.     else
  50.         setPlayerStorageValue(cid, storage, 0)
  51.         doRemoveCondition(cid, CONDITION_OUTFIT)
  52.     end
  53.  
  54.     return true
  55. end
Advertisement
Add Comment
Please, Sign In to add comment