richardestro
New Member
- Joined
- Oct 23, 2023
- Messages
- 15
- Reaction score
- 1
Hey! Looking for some help, i found this revscript that summons a "stronger version" of a killed monster, for TFS 1.3.
I using TFS 1.3, but find out the revscript uses EventCallbacks, and my server isn't compatible with EventCallbacks, I want to know if this is a way to make this work without the EventCallback?
I found the revscript here in the post of @Sarah Wesker : Lua - [TFS 1.3] Free Scripting Service (https://otland.net/threads/tfs-1-3-free-scripting-service.274636/)
Lua:
local spawnbosses = {
["Rotworm"] = {
chance = 50,
bossName = "Demon" -- i use Demon only for test
},
["Dragon"] = {
chance = 50,
bossName = "Dragon Boss"
}
}
local cSpawnBossWhenDie = CreatureEvent("SpawnBossWhenDie")
function cSpawnBossWhenDie.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
local prop = spawnbosses[creature:getName()]
if prop and math.random(100) <= prop.chance then
Game.createMonster(prop.bossName, creature:getPosition())
end
return true
end
cSpawnBossWhenDie:register()
local ev = EventCallback
function ev.onTargetCombat(creature, target)
if creature:isPlayer() and target:isMonster() and spawnbosses[target:getName()] then
target:registerEvent("SpawnBossWhenDie")
end
return RETURNVALUE_NOERROR
end
I using TFS 1.3, but find out the revscript uses EventCallbacks, and my server isn't compatible with EventCallbacks, I want to know if this is a way to make this work without the EventCallback?
I found the revscript here in the post of @Sarah Wesker : Lua - [TFS 1.3] Free Scripting Service (https://otland.net/threads/tfs-1-3-free-scripting-service.274636/)