• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X why necromancer revive rune is getting a delay?

hiwyn

Member
Joined
Aug 30, 2021
Messages
44
Reaction score
7
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:
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
 

4Nathu4

valoria.online
Joined
Oct 27, 2009
Messages
337
Solutions
9
Reaction score
188
GitHub
4mrcn4
Have you considered looking at the corpse? Unmovable corpses have a different ID than the ones (movable) that they decay to
 
OP
OP
hiwyn

hiwyn

Member
Joined
Aug 30, 2021
Messages
44
Reaction score
7
Have you considered looking at the corpse? Unmovable corpses have a different ID than the ones (movable) that they decay to

this i could not revive (the not moveable):
Code:
03:20 You see a dead tarantula (Vol:10).
ItemID: [6060].
DecayTo: [4320].
Position: [X: 1021] [Y: 1044] [Z: 7].

and after some time this i could (the moveable):
Code:
03:20 You see a dead tarantula (Vol:10).
ItemID: [4320].
DecayTo: [4321].
Position: [X: 1020] [Y: 1044] [Z: 7].

but both are on the list



---
same thing happens to ghoul

this does not work:
Code:
03:22 You see a slain ghoul (Vol:10).
ItemID: [5976].
DecayTo: [3113].
Position: [X: 1021] [Y: 1042] [Z: 7].

this works:
Code:
03:22 You see a slain ghoul (Vol:8).
ItemID: [3113].
DecayTo: [3114].
Position: [X: 1020] [Y: 1041] [Z: 7].

---

but i have no idea what is going on, all this items are on the list on the rune
 

krafttomten

Member
Joined
Jul 23, 2017
Messages
57
Solutions
1
Reaction score
21
Location
Sweden
I'm not sure, and maybe this input is not helpful, but the reason why the unmovable corpses exist is to protect the owners right to the loot, so that nobody steals it basically. It would make sense if this system also somehow generally prevents any manipulation of the unmovable corpses..

*edit
I've had trouble manipulating those corpses in the past and I was unable to solve it properly. My case was related to using obsidian knife / blessed wooden stake on the corpses. I solved it by simply changing the corpse spawned by the monsters in the monster_name.xml. Quite the crude solution, it would be much neater to somehow make an exception. But on the other hand, then you could get problems with people destroying loot on your OT
 
OP
OP
hiwyn

hiwyn

Member
Joined
Aug 30, 2021
Messages
44
Reaction score
7
local corpse = getThingFromPos(position)
print(corpse) is printing all 0 on this fresh monsters (that u cant move)
Code:
  [actionid] => 0
  [uid] => 0
  [itemid] => 0
  [type] => 0
anybody here know why?
there is any other way to get the item?
 

Similar threads

Top