Homeslice
-anoyn/Rage the Mage
Title wrong: 1.2 not 1.3
Hello everyone
I am trying to convert the summon spells from this monsterpack from TFS 1.1 to 1.2.
Here is the 1.1 code (data\spells\scripts\monster\white pale summon.lua):
Here is where the spell is started in "White pale.xml"
The spell is called from:
When it hits "mid:setMaster(creature)" the server crashes.
I've checked the luascript.cpp and it shows the parameters are still the same as in 1.1 (creature:setMaster(master)).
When i comment out setMaster the server does not crash and the summon monster is created.
Does anyone know why this is crashing?
Edit: Was a mistake in my TFS 1.2 source changes.
Hello everyone
I am trying to convert the summon spells from this monsterpack from TFS 1.1 to 1.2.
Here is the 1.1 code (data\spells\scripts\monster\white pale summon.lua):
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_NONE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
arr = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}
local area = createCombatArea(arr)
combat:setArea(area)
local maxsummons = 2
function onCastSpell(creature, var)
local summoncount = creature:getSummons()
if #summoncount < 2 then
for i = 1, maxsummons - #summoncount do
local mid = Game.createMonster("Carrion Worm", creature:getPosition())
if not mid then
return
end
mid:setMaster(creature)
end
end
return combat:execute(creature, var)
end
Here is where the spell is started in "White pale.xml"
Lua:
<defenses armor="8" defense="11">
<defense name="white pale summon" interval="2000" chance="80"/>
</defenses>
The spell is called from:
When it hits "mid:setMaster(creature)" the server crashes.
I've checked the luascript.cpp and it shows the parameters are still the same as in 1.1 (creature:setMaster(master)).
When i comment out setMaster the server does not crash and the summon monster is created.
Does anyone know why this is crashing?
Edit: Was a mistake in my TFS 1.2 source changes.
Last edited: