Request dynamic stats auto update script.

vijay

New member
Messages
76
Points
0
Age
33
Location
Bangalore, India.
Emulator
Hello Hercules people.
I'm requesting for a script which much dynamically update stats.
I added a OnPCKillEvent, for every kill we make the stats must be increased but the stats wont change unless i unwield and wield any of my equipped item.
Is there a way to get the effect without unwielding and wielding my equips?
Or can we possible have the users equipped item unwield and wield back on after every kill he/she makes.

I even tired adding sc_start SC_BLIND,1,1;
After the dynamic stat.
But still the stats are not chaining until i wielding my equipped item..

 
Any help is appreciated.
~Thanks!

 
If it is a normal npc you should provide you original npc for reference. Its is easier to help you out or write a new one that is closer to what you want.

If you put that into a item It depends where you put your OnPCKillEvent. If you want something to run anytime you should put it into Script field. My guess it you have it on OnEquipScript.

Code:
item_db: ({	// =================== Mandatory fields ===============================	Id: ID                        (int)	AegisName: "Aegis_Name"       (string, optional if Inherit: true)	Name: "Item Name"             (string, optional if Inherit: true)	// =================== Optional fields ================================	Type: Item Type               (int, defaults to 3 = etc item)	Buy: Buy Price                (int, defaults to Sell * 2)	Sell: Sell Price              (int, defaults to Buy / 2)	Weight: Item Weight           (int, defaults to 0)	Atk: Attack                   (int, defaults to 0)	Matk: Magical Attack          (int, defaults to 0, ignored in pre-re)	Def: Defense                  (int, defaults to 0)	Range: Attack Range           (int, defaults to 0)	Slots: Slots                  (int, defaults to 0)	Job: Job mask                 (int, defaults to all jobs = 0xFFFFFFFF)	Upper: Upper mask             (int, defaults to any = 0x3f)	Gender: Gender                (int, defaults to both = 2)	Loc: Equip location           (int, required value for equipment)	WeaponLv: Weapon Level        (int, defaults to 0)	EquipLv: Equip required level (int, defaults to 0)	EquipLv: [min, max]           (alternative syntax with min / max level)	Refine: Refineable            (boolean, defaults to true)	View: View ID                 (int, defaults to 0)	BindOnEquip: true/false       (boolean, defaults to false)	Script: <"		Script		(it can be multi-line)	">	OnEquipScript: <" OnEquip Script (can also be multi-line) ">	OnUnequipScript: <" OnUnequip Script (can also be multi-line) ">	// =================== Optional fields (item_db2 only) ================	Inherit: true/false           (boolean, if true, inherit the values	                              that weren't specified, from item_db.conf,	                              else override it and use default values)},...)
 
Hi Winterfox, I'm using this script!
 

Code:
- script RoyalWeapon -1,{ OnPCKillEvent:if(isequipped(25621) || isequipped(25622) || isequipped(25623) || isequipped(25624) || isequipped(25625) || isequipped(25626) || isequipped(25627) || isequipped(25628) || isequipped(25629) || isequipped(25630) || isequipped(25631) || isequipped(25632) || isequipped(25633)) {if ( @kill < 10 ) { set @kill,@kill + 1; message strcharinfo(0),"You got "+@kill+" Kills";}}end; OnPCDieEvent:if(isequipped(25621) || isequipped(25622) || isequipped(25623) || isequipped(25624) || isequipped(25625) || isequipped(25626) || isequipped(25627) || isequipped(25628) || isequipped(25629) || isequipped(25630) || isequipped(25631) || isequipped(25632) || isequipped(25633)) {if ( @kill > 0 ) {set @kill, @kill/2; message strcharinfo(0),"You got "+@kill+" Kills";}}end;}
 
Last edited by a moderator:
I am not sure what the issue with that script is, maybe because the command was designed for item scripts. You could try this alternate version: http://pastebin.com/xbGQXSd4

 
Last edited by a moderator:
Thanks for the script Winterfox.
I'm using eAthena 3CeAm final version.

I ported to eathena(im not sure if its correct) but idk whats wrong the stats is not adding.
 

- script RoyalWeapon -1,{        OnInit:                setarray( .@royalWeaponIds, 25621, 25622, 25623, 25624, 25625, 25626, 25627, 25628, 25629, 25630, 25631, 25632, 25633 );        end;        OnPCDieEvent:        set .@died,1;        OnPCKillEvent:                for( set .@i,0; .@i < getarraysize( .@royalWeaponIds ); set .@i,.@i + 1 ) {                        if( getequipid( EQI_HAND_L ) == .@royalWeaponIds[ .@i ] || getequipid( EQI_HAND_R ) == .@royalWeaponIds[ .@i ] ) {                                set .@royalWeaponEquipped,1;                                break;                        }                }               if( !.@royalWeaponEquipped ) end;                                    if( .@died == 1 )                        if ( @kill > 0 )                                set @kill, @kill/2;                    if( !.@died )                        if ( @kill < 10 )                            set @kill,@kill + 1;                    message( strcharinfo(0), "You got "  + @kill + " Kills" );        end;}


This is the weapon script.
 

Code:
25627,Royal_Deathspade,Royal_Deathspade,4,1000000,10,5,250,,1,4,0x000444A2,7,2,2,4,1,1,7,{ bonus bStr,10+(@kill*7); bonus bAllStats,1+(@kill); bonus2 bIgnoreDefRate,RC_DemiHuman,20+@kill; },{ dispbottom "[Royal Weapon] Your power is strong. Power:"+@kill; misceffect 182; misceffect 190; specialeffect2 543; },{}
 
Last edited by a moderator:
Doesn't it add in general or just doesn't work on the item?

 
Nothing happens.
I dint' even get

message( strcharinfo(0), "You got "  + @kill + " Kills" );
After killing using the weapon.

 
Last edited by a moderator:
You should output .@royalWeaponEquipped before the if( !.@royalWeaponEquipped ) end;

And also .@royalWeaponIds[ .@i ] before set .@royalWeaponEquipped,1;

So you can check if your weapon id is found and if it is properly given to the if statement.

You also can replace if( .@died == 1 ) with if( .@died )

 
Last edited by a moderator:
I'm really bad with scripts.

- script RoyalWeapon -1,{        OnInit:                setarray( .@royalWeaponIds, 25621, 25622, 25623, 25624, 25625, 25626, 25627, 25628, 25629, 25630, 25631, 25632, 25633 );        end;        OnPCDieEvent:        set .@died,1;        OnPCKillEvent:                for( set .@i,0; .@i < getarraysize( .@royalWeaponIds ); set .@i,.@i + 1 ) {                        if( getequipid( EQI_HAND_L ) == .@royalWeaponIds[ .@i ] || getequipid( EQI_HAND_R ) == .@royalWeaponIds[ .@i ] ) {                                .@royalWeaponIds[ .@i ] set .@royalWeaponEquipped,1;                                break;                        }                } .@royalWeaponEquipped                if( !.@royalWeaponEquipped ) end;                                    if( .@died )                        if ( @kill > 0 )                                set @kill, @kill/2;                    if( !.@died )                        if ( @kill < 10 )                            set @kill,@kill + 1;                    message( strcharinfo(0), "You got "  + @kill + " Kills" );        end;}


Not working still.

 
Last edited by a moderator:
Fixed by Stolao!

Code:
- script RoyalWeapon -1,{	 OnPCKillEvent:	set .@e,getequipid(EQI_HAND_R);	if(.@e >= 25621 && .@e <= 25633 && @kill < 10){		set @kill,@kill + 1;		message strcharinfo(0),"You got "+@kill+" Kills";		unequip EQI_HAND_R;		equip .@e;	}	end;	 OnPCDieEvent:	set .@e,getequipid(EQI_HAND_R);	if(.@e >= 25621 && .@e <= 25633 && @kill < 10){		set @kill, @kill/2;		message strcharinfo(0),"You got "+@kill+" Kills";		unequip EQI_HAND_R;		equip .@e;	}	end;	 }
and a suggestion should sinx be able to duel wild any of these gear, i recommend adding a check to the item bonus so if its on the left hand it wont function 
eg:
Code:
1201,Knife,Knife,5,50,,400,17,,1,3,0xFE9F7EEF,7,2,2,1,1,1,1,{ if(getequipid(EQI_HAND_R) >= 25621 && getequipid(EQI_HAND_R) <= 25633 && getequipid(EQI_HAND_L) >= 25621 && getequipid(EQI_HAND_L) <= 25633){ message strcharinfo(0),"Duel Wielding Royal Weapons Disables all Effects"; } else { bonus bStr,1; } },{},{}
 
Back
Top