Advertisement
Guest User

Untitled

a guest
Dec 9th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. dofile('data/colossusLib.lua')
  2.  
  3. -- 12995 left --
  4. -- 12997 right --
  5.  
  6. local hand = {12995, 12997}
  7.  
  8. function onCastSpell(creature, variant)
  9.     if spellExecuted then
  10.         return false
  11.     end
  12.  
  13.     if Game.getStorageValue(colossusAwakenGlobalStorage) ~= 1 then
  14.         local creaturePos = creature:getPosition()
  15.         local monTable = {
  16.             {monName = 'Colossus LH', pos = Position(creaturePos.x - 2, creaturePos.y + 2, creaturePos.z)},
  17.             {monName = 'Colossus RH', pos = Position(creaturePos.x + 3, creaturePos.y + 2, creaturePos.z)}
  18.         }
  19.        
  20.         local monster
  21.         for i = 1, #monTable do
  22.             monster = Game.createMonster(monTable[i].monName, monTable[i].pos, false, true)
  23.             monster:setMaster(creature)
  24.         end
  25.  
  26.         Game.setStorageValue(colossusAwakenGlobalStorage, 1)
  27.         return true
  28.     end
  29.  
  30.     local summons = creature:getSummons()
  31.     if #summons == 0 then
  32.         return false
  33.     end
  34.  
  35.     local chance = math.random(100)
  36.     for i = 1, #summons do
  37.         doCastMove(summons[i]:getId(), chance, hand[i])
  38.     end
  39.  
  40.     return true
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement