Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onCastSpell(cid, var)
- local T = {
- {level = {from = 10, to = 50}, mana = 300, monster = "karasu"},
- {level = {from = 51, to = 80}, mana = 350, monster = "karasu"}
- }
- local monster = nil
- for _, V in pairs(T) do
- if(#getCreatureSummons(cid) < 1) then
- if(getPlayerLevel(cid) >= V.level.from and getPlayerLevel(cid) <= V.level.to) then
- if(getCreatureMana(cid) >= V.mana) then
- monster = doCreateMonster(V.monster .. "[" .. _ .. "]", getThingPos(cid))
- doCreatureAddMana(cid, V.mana)
- doConvinceCreature(cid, monster)
- registerCreatureEvent(monster, "summon1")
- else
- doPlayerSendTextMessage(cid, 27, "You don't have mana.")
- end
- else
- doPlayerSendTextMessage(cid, 27, "You don't have level.")
- end
- else
- doPlayerSendTextMessage(cid, 27, "You can't summon more monsters.")
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement