polserver / ModernDistro

Package of scripts and configs needed to run POL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code improvement

andrtechno opened this issue · comments

	var last_damage := struct;
	last_damage.+serial	:= caster.serial;
	last_damage.+time	:= POLCore().systime;
	last_damage.+amount	:= mod_amount;
	last_damage.+type	:= "FeebleMind";
	if ( caster.acctname )
		last_damage.+acctname := caster.acctname;
	endif

	if ( caster.name )
		last_damage.+name := caster.name;
	endif
	SetObjProperty(cast_on, "LastDamage", last_damage);

can it is necessary to take out in syshook methods of the character? or into a function, otherwise, as for me, there is a lot of duplicate code

plus there is already a similar function
damage SetLastDamageInfo

** magic wand

cast_weaken(caster, cast_on)
last_damage.+type	:= "FeebleMind";

"plus there is already a similar function
damage SetLastDamageInfo
"
Good point. Changed code.
cast_weaken(caster, cast_on)
last_damage.+type := "FeebleMind";Changed. Thanks

Chaged. Thanks.