hiwyn
Member
- Joined
- Aug 30, 2021
- Messages
- 78
- Reaction score
- 8
I have this rune that can bring monsters corpses back to life as summon to mages, but there is a problem:
after monster die in my server (GitHub - Fir3element/3777 (https://github.com/Fir3element/3777)) for some seconds it cant be pushed
and when monsters are like that the rune does not work, it shows the message sorry its not possible
why it is happen?
there is a way to fix it or atlast shows, wait some time until u can revive the monster?
rune script:
after monster die in my server (GitHub - Fir3element/3777 (https://github.com/Fir3element/3777)) for some seconds it cant be pushed
and when monsters are like that the rune does not work, it shows the message sorry its not possible
why it is happen?
there is a way to fix it or atlast shows, wait some time until u can revive the monster?
rune script:
Code:
-- mana based on monster health
BodyMonsterNames = {
[5976] = {name = "Ghoul", mana = 100},
[3113] = {name = "Ghoul", mana = 100},
[3114] = {name = "Ghoul", mana = 100},
[3115] = {name = "Ghoul", mana = 100},
[8964] = {name = "Fire Elemental", mana = 280},
[8969] = {name = "Fire Elemental", mana = 280},
[6004] = {name = "Mummy", mana = 240},
[2949] = {name = "Mummy", mana = 240},
[2950] = {name = "Mummy", mana = 240},
[2951] = {name = "Mummy", mana = 240},
-- daqui pra baixo só peguei 2
[6029] = {name = "Crypt Shambler", mana = 330},
[3028] = {name = "Crypt Shambler", mana = 330},
[3029] = {name = "Crypt Shambler", mana = 330},
[3030] = {name = "Crypt Shambler", mana = 330},
[5963] = {name = "Demon Skeleton", mana = 400},
[2809] = {name = "Demon Skeleton", mana = 400},
[2922] = {name = "Demon Skeleton", mana = 400},
[2923] = {name = "Demon Skeleton", mana = 400},
[9875] = {name = "Zombie", mana = 500},
[9876] = {name = "Zombie", mana = 500},
[9877] = {name = "Zombie", mana = 500},
[9878] = {name = "Zombie", mana = 500},
[9938] = {name = "Gozzler", mana = 240},
[9935] = {name = "Gozzler", mana = 240},
[9936] = {name = "Gozzler", mana = 240},
[9937] = {name = "Gozzler", mana = 240},
[9938] = {name = "Gozzler", mana = 240},
[5962] = {name = "Cyclops", mana = 260},
[3069] = {name = "Cyclops", mana = 260},
[2808] = {name = "Cyclops", mana = 260},
[3117] = {name = "Cyclops", mana = 260},
[3118] = {name = "Cyclops", mana = 260},
[7847] = {name = "Cyclops Drone", mana = 325},
[7848] = {name = "Cyclops Drone", mana = 325},
[7849] = {name = "Cyclops Drone", mana = 325},
-- [7743] = {name = "Cyclops Drone", mana = 325},
[7740] = {name = "Cyclops Smith", mana = 435},
[7741] = {name = "Cyclops Smith", mana = 435},
[7742] = {name = "Cyclops Smith", mana = 435},
-- [7743] = {name = "Cyclops Smith", mana = 435},
[6006] = {name = "Vampire", mana = 475},
[2956] = {name = "Vampire", mana = 475},
[2957] = {name = "Vampire", mana = 475},
[2958] = {name = "Vampire", mana = 475},
[9658] = {name = "Vampire Bride", mana = 1200},
[9659] = {name = "Vampire Bride", mana = 1200},
[5973] = {name = "Dragon", mana = 1000},
[3104] = {name = "Dragon", mana = 1000},
[3105] = {name = "Dragon", mana = 1000},
[3106] = {name = "Dragon", mana = 1000},
[3107] = {name = "Dragon", mana = 1000},
[5984] = {name = "Dragon Lord", mana = 1900},
[2881] = {name = "Dragon Lord", mana = 1900},
[2882] = {name = "Dragon Lord", mana = 1900},
[2883] = {name = "Dragon Lord", mana = 1900},
[7091] = {name = "Frost Dragon", mana = 1800},
[7092] = {name = "Frost Dragon", mana = 1800},
[7093] = {name = "Frost Dragon", mana = 1800},
[7094] = {name = "Frost Dragon", mana = 1800},
[8941] = {name = "Wyrm", mana = 1825},
[8942] = {name = "Wyrm", mana = 1825},
[8943] = {name = "Wyrm", mana = 1825},
[8944] = {name = "Wyrm", mana = 1825},
[6060] = {name = "Tarantula", mana = 225},
[4320] = {name = "Tarantula", mana = 225},
[4321] = {name = "Tarantula", mana = 225},
[4322] = {name = "Tarantula", mana = 225},
[5977] = {name = "Giant Spider", mana = 1300},
[2857] = {name = "Giant Spider", mana = 1300},
[2858] = {name = "Giant Spider", mana = 1300},
[2859] = {name = "Giant Spider", mana = 1300},
[6048] = {name = "Hydra", mana = 2350},
[4283] = {name = "Hydra", mana = 2350},
[4284] = {name = "Hydra", mana = 2350},
[4285] = {name = "Hydra", mana = 2350},
[8955] = {name = "Grim Reaper", mana = 3900},
[8956] = {name = "Grim Reaper", mana = 3900},
[8957] = {name = "Grim Reaper", mana = 3900},
[8958] = {name = "Grim Reaper", mana = 3900}
}
local function doTargetCorpse(cid, position)
position.stackpos = 255
-- from config.lua:
-- local maxSummons = getConfigValue('maxPlayerSummons')
-- fuck config.lua:
local maxSummons = 3
local corpse = getThingFromPos(position)
monster = BodyMonsterNames[corpse.itemid]
if(monster and getCreatureSkullType(cid) ~= SKULL_BLACK) then
if #getCreatureSummons(cid) >= maxSummons then
return (doPlayerSendCancel(cid, "You cannot summon more creatures.") and doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)) and true
end
local reqMana = monster.mana * 2
if (getPlayerMana(cid) < reqMana) then
return (doPlayerSendCancel(cid, "You need " .. reqMana .. " mana points to revive this monster.") and doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)) and true
end
local createMonster = doCreateMonster(monster.name, position)
if createMonster then
doPlayerAddMana(cid, (reqMana * -1))
doCreatureSetSkullType(createMonster, SKULL_YELLOW)
setCreatureMaxHealth(createMonster, (getCreatureHealth(createMonster) / 2))
doCreatureAddHealth(createMonster, getCreatureHealth(createMonster) / 2)
doConvinceCreature(cid, createMonster)
doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
doRemoveItem(corpse.uid)
return true
end
end
doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return false
end
function onCastSpell(cid, var)
local position = variantToPosition(var)
if(position.x ~= 0 and position.y ~= 0) then
return doTargetCorpse(cid, position)
end
doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return false
end