vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 47
Hi, someone can add to this script
- Teleport if summon not see summoner
- And cooldown for this summon (he is on rl, after 15 min summon was dead and summoner get cd for spell, if its to difficulty, only cooldown for summon life)
Code:
local max = 1
function onCastSpell(cid, var)
local dir = getPlayerLookDir(cid)
local ppos = getPlayerPosition(cid)
if(dir==1)then
ppos.x = ppos.x + 1
elseif(dir==2)then
ppos.y = ppos.y + 1
elseif(dir==3)then
ppos.x = ppos.x - 1
elseif(dir==0)then
ppos.y = ppos.y - 1
end
local count, pos = #getCreatureSummons(cid), getThingPos(cid)
if count == max then
doPlayerSendCancel(cid, 'You cannot summon any more monsters.')
doSendMagicEffect(pos, CONST_ME_POFF)
return false
end
local v = doConvinceCreature(cid, doCreateMonster("Skullfrost", ppos))
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
return true
end
- Teleport if summon not see summoner
- And cooldown for this summon (he is on rl, after 15 min summon was dead and summoner get cd for spell, if its to difficulty, only cooldown for summon life)