Simple Spell I made

Discussion in 'Support' started by mikebadeaux, Feb 10, 2012.

  1. mikebadeaux

    mikebadeaux Mapper

    Joined:
    May 16, 2010
    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    make a .LUA called
    and put this in




    .XML




    Edit vocs if u like
    REP++
     
    Last edited: Feb 10, 2012
  2. Mooosie

    Mooosie - Lua Scripter -

    Joined:
    Aug 2, 2008
    Messages:
    702
    Likes Received:
    27
    Best Answers:
    0
    These days is it very simple to create a basic action/creaturescript/movement/weapon. You just have to copy and paste the file you can do anything with. For example, shovel.lua:
    Code (Lua):
    1. local holes = {468, 481, 483, 7932, 8579}
    2. local sand = {231, 9059}
    3.  
    4. function onUse(cid, item, fromPosition, itemEx, toPosition)
    5.     if(isInArray(holes, itemEx.itemid)) then
    6.         local newId = itemEx.itemid + 1
    7.         if(itemEx.itemid == 8579) then
    8.             newId = 8585
    9.         end
    10.  
    11.         doTransformItem(itemEx.uid, newId)
    12.         doDecayItem(itemEx.uid)
    13.     elseif(isInArray(sand, itemEx.itemid)) then
    14.         local rand = math.random(1, 100)
    15.         if(itemEx.actionid  == 100 and rand <= 20) then
    16.             doTransformItem(itemEx.uid, 489)
    17.             doDecayItem(itemEx.uid)
    18.         elseif(rand >= 1 and rand <= 5) then
    19.             doCreateItem(2159, 1, toPosition)
    20.         elseif(rand > 85) then
    21.             doCreateMonster("Scarab", toPosition, false)
    22.         end
    23.  
    24.         doSendMagicEffect(toPosition, CONST_ME_POFF)
    25.     end
    26.  
    27.     return true
    28. end
    Just remove the content:
    Code (Lua):
    1. function onUse(cid, item, fromPosition, itemEx, toPosition)
    2.  
    3.  
    4.     return true
    5. end
    6.  
    And just start your own basic script. If you want help just go to "YOURSERVERFOLDER/doc/LUAFUNCTIONS" there are all functions you can use.

    That was a quick tutorial, but topic:

    Thanks for sharing and this was my first step too. To create my own spell using one spell template.
     

Share This Page

Loading...