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

Solved [8.54] TFS spells weird problem

Ramirow

Veteran OT User
Joined
Aug 22, 2009
Messages
584
Solutions
15
Reaction score
301
Location
Argentina
YouTube
ramirogrant
Hello to all, I have been using an spellcreator to create some useful spells for my project.

This is the spellcreator: http://otland.net/f19/spellcreator-graphical-spell-creation-enviroment-160371/

Well, I have correctly added the spells in spells.xml and the .lua file in the scripts folder, the server loads fine, no errors..I tested the spell effects on a god character, everything worked pretty good. So I decided to test damage output for different lvl and ml values, and..Surprise! When a normal players tries to cast ANY of these spells, the server stop responding, it doesn't crash but it seems it gets some sort of freeze (I notice that when this happens my computer suffers an overall slowdown that ends when I close the server)

I had custom vocations in my server, so I thought maybe that was the reason, I extracted the original vocations.xml from the distro and putted it in my server, loaded fine, tried to cast the spell, same weird thing happens..

So I thought it may be the spell script when a player tries to cast it, so I added again the exura spell ('cause I dropped it from the spell list) and it does the same! So I think it's a server problem?

Using TFS 0.3.6pl1


Here is one of the basic spell scripts:

blizzard.lua
Lua:
-- SpellCreator generated.

-- =============== COMBAT VARS ===============
-- Areas/Combat for 0ms
local combat0_Blizzard = createCombatObject()
setCombatParam(combat0_Blizzard, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatParam(combat0_Blizzard, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatArea(combat0_Blizzard,createCombatArea({{2},
{1}}))
function getDmg_Blizzard(cid, level, maglevel)
	return (15)*-1,(30)*-1 
end
setCombatCallback(combat0_Blizzard, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Blizzard")
local dfcombat0_Blizzard = {CONST_ANI_SMALLICE,0,1}

-- =============== CORE FUNCTIONS ===============
local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part
	if (isCreature(cid)) then
		doCombat(cid, c, var)
		if (dirList ~= nil) then -- Emit distance effects
		local i = 2;
			while (i < #dirList) do
				doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList[i],y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1])
				i = i + 2
			end		
		end
	end
end

function onCastSpell(cid, var)
	local startPos = getCreaturePosition(cid)
	RunPart(combat0_Blizzard,cid,var,dfcombat0_Blizzard,startPos)
	return true
end

And this is how it was added in spells.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<instant name="Blizzard" words="exori frigo" lvl="10" maglv="1" mana="25" exhaustion="2000" prem="0" needlearn="1" needtarget="1" blockwalls="0" aggressive="1" event="script" value="Blizzard.lua">
	<vocation id="1"/>
	<vocation id="4"/>
	<vocation id="6"/>
</instant>
</spells>

And just in case, this is my custom vocations.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
	<vocation id="0" name="none" description="none" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="2" gainmanaticks="6" gainmanaamount="2" manamultiplier="4.0" attackspeed="2000" soulmax="10" gainsoulticks="120" fromvoc="0" attackable="no">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="1" name="Adventurer" description="an adventurer" needpremium="0" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="2" gainmanaticks="6" gainmanaamount="2" manamultiplier="3.0" attackspeed="2000" soulmax="10" gainsoulticks="120" fromvoc="1">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="2" name="Magician" description="a magician" needpremium="0" gaincap="10" gainhp="5" gainmana="25" gainhpticks="6" gainhpamount="2" gainmanaticks="3" gainmanaamount="4" manamultiplier="1.1" attackspeed="2000" soulmax="50" gainsoulticks="120" fromvoc="2">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="3" name="Rogue" description="a rogue" needpremium="0" gaincap="10" gainhp="10" gainmana="10" gainhpticks="4" gainhpamount="2" gainmanaticks="4" gainmanaamount="4" manamultiplier="1.4" attackspeed="1750" soulmax="50" gainsoulticks="120" fromvoc="3">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="4" name="Mercenary" description="a mercenary" needpremium="0" gaincap="10" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="2" gainmanaticks="6" gainmanaamount="4" manamultiplier="3.0" attackspeed="2000" soulmax="50" gainsoulticks="120" fromvoc="4">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.1" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="5" name="Wizard" description="a wizard" needpremium="0" gaincap="10" gainhp="5" gainmana="40" gainhpticks="4" gainhpamount="3" gainmanaticks="2" gainmanaamount="6" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="15" fromvoc="2" lessloss="30">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.1" magDamage="1.1" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.5" club="2.0" sword="2.0" axe="2.0" distance="2.0" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="6" name="Priest" description="a priest" needpremium="0" gaincap="10" gainhp="5" gainmana="40" gainhpticks="4" gainhpamount="3" gainmanaticks="2" gainmanaamount="6" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="15" fromvoc="2" lessloss="30">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.1" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.5" club="1.8" sword="1.8" axe="1.8" distance="1.8" shielding="1.5" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="7" name="Assassin" description="an assassin" needpremium="0" gaincap="15" gainhp="15" gainmana="15" gainhpticks="4" gainhpamount="3" gainmanaticks="4" gainmanaamount="6" manamultiplier="1.4" attackspeed="1500" soulmax="100" gainsoulticks="15" fromvoc="3" lessloss="30">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.2" club="1.2" sword="1.2" axe="1.2" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="8" name="Archer" description="an archer" needpremium="0" gaincap="20" gainhp="15" gainmana="15" gainhpticks="4" gainhpamount="3" gainmanaticks="4" gainmanaamount="6" manamultiplier="1.4" attackspeed="1750" soulmax="100" gainsoulticks="15" fromvoc="3" lessloss="30">
		<formula meleeDamage="1.0" distDamage="1.1" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.4" club="1.3" sword="1.3" axe="1.3" distance="1.1" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="9" name="Paladin" description="a paladin" needpremium="0" gaincap="15" gainhp="25" gainmana="5" gainhpticks="2" gainhpamount="3" gainmanaticks="4" gainmanaamount="6" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="15" fromvoc="4" lessloss="30">
		<formula meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.1" armor="1.1"/>
		<skill fist="1.2" club="1.1" sword="1.1" axe="1.1" distance="1.4" shielding="1.0" fishing="1.1" experience="1.0"/>
	</vocation>
	<vocation id="10" name="Berserker" description="a berserker" needpremium="0" gaincap="15" gainhp="20" gainmana="5" gainhpticks="2" gainhpamount="3" gainmanaticks="4" gainmanaamount="6" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="15" fromvoc="4" lessloss="30">
		<formula meleeDamage="1.1" distDamage="1.0" wandDamage="1.0" magDamage="1.0" magHealingDamage="1.0" defense="1.0" magDefense="1.0" armor="1.0"/>
		<skill fist="1.0" club="1.0" sword="1.0" axe="1.0" distance="1.4" shielding="1.1" fishing="1.1" experience="1.0"/>
	</vocation>
</vocations>
 
Last edited:
the problem is not the vocations, post your entire spells.xml... if it works on god without problems it may work fine on players, maybe your distro is broken

also you may ask too in the program thread
 
Back
Top