Spells Bug

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.
Locked
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Spells Bug

Post by ELSoft »

paralyze.src

Code: Select all

use uo;
use os;

include ":magery:spells";
include ":timedscripts:timedScripts";

program SpellScript_Paralyze(params)
	var mobile := params[1];
	var info := params[2];
	var targ := params[3];
	params := 0;

	if ( !MS_MobileCheck(mobile, targ) )
		return 0;
	endif
	
	MS_PlaySpellSFX(info.spell_id, targ);
	MS_PlaySpellGFX(info.spell_id, targ, mobile);

	// Duration: ((caster Eval Int/10) - ((target Resist Magic/10)) * 3 seconds
	var duration := CInt((AP_GetSkill(mobile, EVALUATING_INTELLIGENCE) - (AP_GetSkill(targ, RESISTING_SPELLS) / 10)) * 3);
	TS_StartTimer(targ, "Paralysis", duration);
endprogram
the spell duration is wrong, this should be

var duration := CInt((AP_GetSkill(mobile, EVALUATING_INTELLIGENCE)/10 - AP_GetSkill(targ, RESISTING_SPELLS) / 10) * 3);

or

var duration := CInt( ( (AP_GetSkill(mobile, EVALUATING_INTELLIGENCE) - AP_GetSkill(targ, RESISTING_SPELLS)) / 10) * 3);
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Post by ELSoft »

There is another little bug in the spell Incognito more specifically in the endIncognito.src.

At the end of the script is missing a

EraseObjProperty(mobile, "Incognito");


because if you need to know when a player is "Incognito", allways
appear that this.
Ventura
New User
Posts: 10
Joined: Fri Sep 08, 2006 10:41 pm

Re: Spells Bug

Post by Ventura »

POLDistro99.

Hi everyone,
I am having problem with any kind of spells that changes the character status like boosts or curses... the client stucks and everytime i try to login with that character the client stucks again.

Here the code for bless
pkg\systems\spells\spellScripts\circle3\bless.src
------------------------------------------------------------------------------------------------------------------------------------
use uo;
use os;

include ":spells:spells";
include ":timedscripts:timedScripts";

program SpellScript_Bless( params )

var mobile := params[1];
var info := params[2];
var targ := params[3];
//var circle := SPELL_GetCircle( info.spell_id );
params := 0;

if( !SPELL_MobileCheck( mobile, targ ))
return 0;
elseif( GetObjProperty( targ, "BlessMod" ))
SendSysMessage( mobile, "Already under the influence!" );
return 0;
elseif( GetObjProperty( targ, "CurseMod" ))
SendSysMessage( mobile, "Already under the influence!" );
return 0;
endif

SPELL_PlaySpellSFX( info.spell_id, targ );
SPELL_PlaySpellGFX( info.spell_id, targ, mobile );

var amount := SPELL_GetAmount( mobile ),
duration := SPELL_GetDuration( mobile );

SendBoostMessage( mobile, targ, "bless", amount, duration );

TS_StartTimer( targ, "Bless", duration, amount, mobile );

return 1;
endprogram

After some tests i found out that the function "TS_StartTimer( targ, "Bless", duration, amount, mobile );" is causing the problem...
i also found this ( CProp %TimerList% d1:S5:Blesst4:S8:durationi3300S7:endtimei735220S5:leveli61S4:nameS5:Bless ) inside POL99\Distro\data\pcs.txt and deleting it fix the bug so i can log in again without any problem.

heres the code for TS_StartTimer() function
pkg\systems\timedScripts\include\timedscripts.inc
------------------------------------------------------------------------------------------------------
function TS_StartTimer( mobile, timer_name, duration, level:=0, attacker:=0 )

duration := CInt( duration );
if( duration < 1 )
return error{"errortext":="Error::TS_StartTimer() - Duration must be greater than 0."};
endif
var event := struct;
event.+type := EVENT_ADD_TIMER;
event.+name := CStr(timer_name);
event.+amount := duration;
event.+level := CInt(level);
event.+attacker := attacker;

var process := TS_GetControllerProcess( mobile, START_CONTROLLER );
return process.SendEvent( event );
endfunction


Can anyone help me to fix this problem?
thanks everyone.
Ventura
New User
Posts: 10
Joined: Fri Sep 08, 2006 10:41 pm

Re: Spells Bug

Post by Ventura »

Ok, I fix it just by changing the client version from 4.0.0 to 5.0.6c and the problem is gone... :)

Well if someone is having this problem... that`s now to fix it.
Thanks distro team.
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm

Re: Spells Bug

Post by *Edwards »

It's because distro099 actually uses the buff icon system. I'm not sure when exactly that feature was added to client but 6.0.1 has it and it works well. I may have added a link to allow or disallow the feature in pkg/systems/timedScripts/config/settings.cfg
Locked