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 );
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.
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