clario
OTS based on Heroes III Might and Magic
- Joined
- Feb 4, 2018
- Messages
- 98
- Reaction score
- 5
Hello there ! I want to make a spell witch summon a skeletons form bodies (witch i got it in my backpack - 3012 id)
i just created/mixed that :
HERE HE DONT NEED CORPS:
Its very important to me that , ppl shouldnt do more than 5 skeletons(by other hand there will be some other creatures in others spells)
the problem is that the spell remove larva "corpses" form bp , but he dont need it to cast that spell .Im thinkink about the sollution of that its needed to got that corpse in bp .
So if you dont have item id 3012 in bp you cant cast that spell.
Any ideas?
i just created/mixed that :
local max = 5
local t = {
[{1,20}] = {name='Skeleton', outfit=33, hp=54},
[{21,99999}] = {name='Skeleton Warrior', outfit=298, hp=60},
}
function onCastSpell(cid, var)
local parameters = {cid = cid, var = var}
local count, pos = #getCreatureSummons(cid), getThingPos(cid)
if count >= max then
doPlayerSendCancel(cid, 'You cannot make more summons.')
doSendMagicEffect(pos, CONST_ME_POFF)
return false
end
if getPlayerItemCount(cid, 3012) < 2 then
doPlayerSendTextMessage(cid, 26, "I need 2 corpses to cast spell")
end
local lvl = getPlayerLevel(cid)
for a, b in pairs(t) do
if lvl >= a[1] and lvl <= a[2] then
for i = 1, max - count do
local v = doSummonMonster(cid, b.name)
if v ~= 1 then
doPlayerSendDefaultCancel(cid, v)
doSendMagicEffect(pos, CONST_ME_POFF)
return i ~= 1
end
local k = getCreatureSummons(cid)[count+i]
doSendMagicEffect(getThingPos(k), CONST_ME_SMALLCLOUDS)
setCreatureMaxHealth(k, b.hp)
doCreatureAddHealth(k, b.hp)
doCreatureChangeOutfit(k, {lookType=b.outfit})
end
if getPlayerItemCount(cid, 3012) >= 2 then
doPlayerRemoveItem(cid, 3012, 2)
end
break
end
end
doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
return true
end
HERE HE DONT NEED CORPS:
Its very important to me that , ppl shouldnt do more than 5 skeletons(by other hand there will be some other creatures in others spells)
the problem is that the spell remove larva "corpses" form bp , but he dont need it to cast that spell .Im thinkink about the sollution of that its needed to got that corpse in bp .
So if you dont have item id 3012 in bp you cant cast that spell.
Any ideas?