Damage()

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
gundamwing84
Grandmaster Poster
Posts: 178
Joined: Tue Sep 08, 2009 1:57 am

Damage()

Post by gundamwing84 »

ok so Damage() was taken out of uo.em, is there another function that will suffice that is currently used in vitals.em(everything was moved there for health and damage as i understand)? the script function i have for it is:

Code: Select all

function DoSilverHit (byref attacker, byref defender, byref rawdamage);
	if (!IsAnUndeadCreature (defender.npctemplate))
		return;
	endif

	PlayObjectCenteredEffect (defender, FX_GLOW, 7, 7);
	ApplyRawDamage (defender, rawdamage);

	if (GetObjProperty (defender, "summoned"))
		PlaySoundEffect (attacker, SFX_SPELL_MANA_VAMPIRE);
		if (!checkskill (defender, SKILLID_MAGICRESISTANCE, -1, 0))
			PlayStationaryEffect (defender.x, defender.y, defender.z, FX_SMOKE, 0xA, 0xA );
			MoveObjectToLocation (defender, 5288, 1176, 0, MOVEOBJECT_FORCELOCATION);
			damage (defender, GetVital (defender, "Life") + 100);
		endif
	endif
endfunction
and obviously the error im getting is

Code: Select all

Compiling: d:/shard2/Broken Blade/pkg/mithcombat/hitscripts/main_melee.src
Token '(' cannot follow token 'damage'
Function damage() is not defined.
Error compiling statement at d:\shard2\Broken Blade\pkg\mithcombat\hitscripts\main_melee.src, Line 222
Error in IF statement starting at File: d:\shard2\Broken Blade\pkg\mithcombat\hitscripts\main_melee.src, Line 219
Error compiling statement at d:\shard2\Broken Blade\pkg\mithcombat\hitscripts\main_melee.src, Line 219
Error in IF statement starting at File: d:\shard2\Broken Blade\pkg\mithcombat\hitscripts\main_melee.src, Line 217
Error compiling statement at d:\shard2\Broken Blade\pkg\mithcombat\hitscripts\main_melee.src, Line 217
Error in function 'DoSilverHit', File: d:\shard2\Broken Blade\pkg\mithcombat\hitscripts\main_melee.src, Line 222

Error in function 'DoSilverHit'.
File: d:\shard2\Broken Blade\pkg\mithcombat\hitscripts\main_melee.src, Line 222
because it is no longer in the core :( i read up on it in the changelog and there was nothing said about it being changed to something, only that it was removed. am i able to replace Damage() with something else or does this script need to be re-written?

please and thankyou for the help guys,

-mat :)
User avatar
AsYlum
Grandmaster Poster
Posts: 115
Joined: Sun Feb 05, 2006 5:24 am

Re: Damage()

Post by AsYlum »

You can use:

Code: Select all

ApplyRawDamage (defender, GetVital (defender, "Life") + 100);
You don't have to check anything else because that line always kills summoned npc.
gundamwing84
Grandmaster Poster
Posts: 178
Joined: Tue Sep 08, 2009 1:57 am

Re: Damage()

Post by gundamwing84 »

thankyou very much it helped greatly :)
Post Reply