• 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!

Weapon Charges and Monster Spawn

white91

New Member
Joined
Jun 4, 2008
Messages
136
Reaction score
0
I have to questions. I'm using tfs 0.3.6 and i wanna make weapon with 1000 charges but when i use
doPlayerAddItem(cid,10944,1000)
but it create only weapon with 100 charges.
Next question is how make monsters spawn 120 sec and ignore if players on screen.
 
creaturescripts.xml:
Code:
<event type="death" name="respawn" event="script" value="respawn.lua"/>
creaturescripts/scripts/respawn.lua:
Code:
local Respawns = 
    {
        ["demon1"] = 
            {
                spawnPos = {x=33105, y=31691, z=12},
                effectPos = {x=33107, y=31691, z=12}
            },
            
        ["demon2"] = 
            {
                spawnPos = {x=33113, y=31710, z=12},
                effectPos = {x=33111, y=31710, z=12}
            },
            
        ["demon3"] = 
            {
                spawnPos = {x=33117, y=31722, z=12},
                effectPos = {x=33115, y=31722, z=12}
            },
            
        ["demon4"] = 
            {
                spawnPos = {x=33123, y=31706, z=12},
                effectPos = {x=33123, y=31709, z=12}
            },
            
        ["demon5"] = 
            {
                spawnPos = {x=33127, y=31694, z=12},
                effectPos = {x=33125, y=31694, z=12}            
            }
        --Continue adding the others 3, use small letter.
    }
function onDeath(cid, corpse, killer)
    local monsterName = string.lower(getCreatureName(cid))
    local respawnMonster = Respawns[monsterName]
    if respawnMonster then
        doSummonCreature(monsterName, respawnMonster.spawnPos)    
        doSendMagicEffect(respawnMonster.effectPos, CONST_ME_MORTAREA)
    end
    return TRUE
end
Also, you gotta add this in all monsters you want to react on the script:
under </flags> add:
Code:
<script>
    <event name="respawn"/>
</script>
It's an old script someone made for me when real tibia added inquisition
change demon1,2,3,4,5 for the names of the monsters that you want to spawn again when they die(they will be respawned directly after it dies. I recommend you not having more than 1 of the monsters with the same name on the map(I hope you get what I mean)
 
It's better to use onKill function and `kill` event. So there is no need to declare event in monster file (name check will do the trick).

@Cykotitan
Rofl, you gave me an ultimate idea with this spawn thing :D
 
Back
Top