Could someone heeeeelp me? TAT

For posting bug reports and fixes for scripts in the POL distro.
Not for discussion of third party script releases, or core bugs.

Moderators: POL Developer, Distro Developer

Post Reply
flamewing
Neophyte Poster
Posts: 31
Joined: Thu Dec 04, 2008 6:10 am

Could someone heeeeelp me? TAT

Post by flamewing »

Hi there!
I have a very serious problem. :( :( :(
I used the distro script as a server,and some of my friends are playing in it.
One of them found a BUG to make the character’s Stats to increased to a high degree you cannot imagine.
They used the "Bless" magic to buff the character,and logoff,and wait a few minutes to let the character logoff completely that means others cannot see this character.Then they logon and the stats goes up,the value exactly the same as the "bless" spell,and it will never goes down.
I used the ".info" to check this,I found that the values were all Statsmods,and even the buff time goes out,the statsmods were still there.
I love this script and I want to make a nice shard for my friends.
But my ability is limited.
So could someone please tell me how to fix this?
I'll very appreciate your help.
Sorry for my bad English.
Have a nice day!Thanks a lot! :bacondance:
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Could someone heeeeelp me? TAT

Post by boberski »

FIrst of all stop duping posts, you wrote once and thats more than enough.

Make sure that you have basic stats in CProps of your character.
Write login script that will reset character skills to basic valuses.
After that remove CProp.
flamewing
Neophyte Poster
Posts: 31
Joined: Thu Dec 04, 2008 6:10 am

Re: Could someone heeeeelp me? TAT

Post by flamewing »

aderal wrote:FIrst of all stop duping posts, you wrote once and thats more than enough.

Make sure that you have basic stats in CProps of your character.
Write login script that will reset character skills to basic valuses.
After that remove CProp.
I'm sorry for the duping posts.I just very worried about this.
I found the timescript has the endbless.src,and in that config like:

Code: Select all

TimerElem Bless
{
	Name			Bless
	Script			subScripts/magery/Bless
	EndScript		subScripts/magery/EndBless
	LogOffScript	subScripts/magery/EndBless
	StopOnDeath	1
        BuffIcon                1048
}
and I found

Code: Select all

use uo;
use os;

include ":attributes:attributes";

program TimedScript_EndBless( params )

	var mobile := params[1];
	    params := 0;

	var points := CInt( GetObjProperty( mobile, "BlessMod" ));
        AP_ModifyStatMod(mobile, DEXTERITY, -( points ));
        AP_ModifyStatMod(mobile, STRENGTH, -( points ));
        AP_ModifyStatMod(mobile, INTELLIGENCE, -( points ));
	
	EraseObjProperty( mobile, "BlessMod" );

	return 1;
endprogram
I tested the Stopondeath,worked perfect,but the Logoffscript did't work at all.
where should I to fix this?
flamewing
Neophyte Poster
Posts: 31
Joined: Thu Dec 04, 2008 6:10 am

Re: Could someone heeeeelp me? TAT

Post by flamewing »

Sloved!
Hell yeah!
I found the problem is

Code: Select all

AP_ModifyStatMod
this bad thing in Bless and others BUFF/DEBUFF scripts
I changed like this:

Code: Select all

use uo;
use os;

include ":attributes:attributes";

program TimedScript_Bless( params )

	var defender := params[1],
	    //attacker := params[2],
	    points := params[3];
	    params := 0;

	SetObjProperty( defender, "BlessMod", points );
 
	AP_SetStatMod( defender, DEXTERITY, points );//修改 "AP_ModifyStatMod" 为 "AP_SetStatMod" 
	AP_SetStatMod( defender, STRENGTH, points );//让人物登录时不再增涨三围属性,其他buff同理
	AP_SetStatMod( defender, INTELLIGENCE, points );//By 祖鲁中国 Alucardxlx

	return 1;
endprogram
建议POL官方团队将Distro的脚本内容修正为我修改的内容
祖鲁中国&黑白工会

Suggest the POL official team to modify the content of the Distro script to modify my content
ZuluCN Alucardxlx[Black&White Guild]
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: Could someone heeeeelp me? TAT

Post by DevGIB »

I think the problem is elsewhere.

On line 79 of /pkg/systems/timedScripts/timerControl.src you should see:

AddNewTimer( mobile, event, timer_list, elem_info );

change it to

AddExistingTimer( mobile, event, timer_list, elem_info );

Should fix the problem.
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: Could someone heeeeelp me? TAT

Post by boberski »

You necromancer... :deadhorse: :D
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Could someone heeeeelp me? TAT

Post by Yukiko »

As I seem to have unofficially become the "maintainer" of the "Distro" as well as the Distro_Alt repos I have made the change posted by "Necromancer" DevGIB. Please post if that fix works or doesn't work.
DevGIB
Grandmaster Poster
Posts: 248
Joined: Mon Feb 06, 2006 6:12 am

Re: Could someone heeeeelp me? TAT

Post by DevGIB »

The logic behind why this fix should work (and from my testing does), That particular line is within Start Up function which is run when you log back in.

As the timers effects are already applied if it runs "AddNewTimer" it runs the bless script again which applies a new bless.

So yes changing bless to check if bless is already applied from within the bless script will fix the problem, however it will only fix it for bless and the fault could arise somewhere else and with other scripts which could have larger effects but less known because they aren't as visual.

Changing it to "AddExistingTimer" just gets the timer running again so that it continues to count down but doesn't apply the bless effect again.
Yukiko
Distro Developer
Posts: 2825
Joined: Thu Feb 02, 2006 1:41 pm

Re: Could someone heeeeelp me? TAT

Post by Yukiko »

I think your logic makes sense as far as I understand the "Distro" DevGIB. I mean the name of the function implies that it's not adding but taking an existing timer so it makes sense to me. That's why I applied your fix to the "Distro". I'd still like feedback just to make sure. It's always prudent to verify these things. :)
Post Reply