Jump to content
  • 0

Request dynamic stats auto update script.


Question

Posted (edited)

Hello rAthena people.
I'm request for a script which much dynamically update stats.
I'm requesting this script because 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.

Any help is appreciated.
~Thanks!


I'm using this weapon script.
https://rathena.org/board/topic/102352-weapon-stats-request/

Edited by vijay30393

14 answers to this question

Recommended Posts

Posted

try adding an SC after both of your

message strcharinfo(0),"You got "+@kill+" Kills";

eg.

sc_start SC_BLIND,1,1;

this will make it so the player data updates, the same thing applies to my weapon mastery script

 

 

id choose a different SC they can be found in your /db/const.txt

Posted (edited)

Thanks you, will try that!

I even tired adding sc_start SC_BLIND,1,1;
Still the stats is not updating.

Here is the script itself.

 

- 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";
sc_start SC_BLIND,1,1;
}
}
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";
sc_start SC_BLIND,1,1;
}
}
end;

}
Edited by Emistry
use CODEBOX.
Posted

try this

- 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:

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; } },{},{}

if you made sinx only able to use a katar this isn't necessary

Posted (edited)

Thanks a lot Stolao.
Fixed like charm!
Little modification, can you unequip and reequip the left or right acc instead of weapon itself?
Because if we unequip weapon and reequip it, the endow will become neutral. so...
~Thanks.

Edited by vijay30393
Posted

Thanks a lot Stolao.

Fixed like charm!

Little modification, can you unequip and reequip the left or right acc instead of weapon itself?

Because if we unequip weapon and reequip it, the endow will become neutral. so...

~Thanks.

glad it worked

Posted
-    script    RoyalWeapon    -1,{
    
OnPCKillEvent:
    set .@g,getequipid(EQI_GARMENT);
    set .@e,getequipid(EQI_HAND_R);
    if(.@e >= 25620 && .@e <= 25633 && @kill < 10){
        set @kill,@kill + 1;
        message strcharinfo(0),"You got "+@kill+" Kills";
        unequip EQI_GARMENT;
        equip .@g;
    }
    end;
    
OnPCDieEvent:
    set .@g,getequipid(EQI_GARMENT);
    set .@e,getequipid(EQI_HAND_R);
    if(.@e >= 25620 && .@e <= 25633 && @kill < 10){
        set @kill, @kill/2;
        message strcharinfo(0),"You got "+@kill+" Kills";
        unequip EQI_GARMENT;
        equip .@g;
    }
    end;
    
}
Posted (edited)

Thanks again, can i please make a request?
Its about Duel Wielding.

Can you please Disables all Effects if any of these weapon combination is used.

Items:
3183
3189
3522
3528
3503
3509
25626

Thanks again!

Tried this but it din't work.

Not working:
3528,Fury_Stealth_Wing,Fury Stealth Wing,4,1000000,10,5,350,,1,4,0x000654E2,7,2,2,4,1,1,2,{ if((getequipid(EQI_HAND_R) ==3183 && (getequipid(EQI_HAND_R) ==3183 && (getequipid(EQI_HAND_L) ==3183 && (getequipid(EQI_HAND_L) ==3183 (getequipid(EQI_HAND_R) ==3189 && (getequipid(EQI_HAND_R) ==3189 && (getequipid(EQI_HAND_L) ==3189 && (getequipid(EQI_HAND_L) ==3189 (getequipid(EQI_HAND_R) ==3522 && (getequipid(EQI_HAND_R) ==3522 && (getequipid(EQI_HAND_L) ==3522 && (getequipid(EQI_HAND_L) ==3522 (getequipid(EQI_HAND_R) ==3528 && (getequipid(EQI_HAND_R) ==3528 && (getequipid(EQI_HAND_L) ==3528 && (getequipid(EQI_HAND_L) ==3528 (getequipid(EQI_HAND_R) ==3503 && (getequipid(EQI_HAND_R) ==3503 && (getequipid(EQI_HAND_L) ==3503 && (getequipid(EQI_HAND_L) ==3503 (getequipid(EQI_HAND_R) ==3509 && (getequipid(EQI_HAND_R) ==3509 && (getequipid(EQI_HAND_L) ==3509 && (getequipid(EQI_HAND_L) ==3509 (getequipid(EQI_HAND_R) ==25626 && (getequipid(EQI_HAND_R) ==25626 && (getequipid(EQI_HAND_L) ==25626 && (getequipid(EQI_HAND_L) ==25626)){ message strcharinfo(0),"Duel Wielding Royal Weapons Disables all Effects"; } else { bonus bAllStats,13; bonus2 bAddRace,RC_DemiHuman,15; }},{},{}
Edited by vijay30393
Posted

 

Thanks again, can i please make a request?

Its about Duel Wielding.

Can you please Disables all Effects if any of these weapon combination is used.

Items:
3183
3189
3522
3528
3503
3509
25626

Thanks again!

Tried this but it din't work.

Not working:
3528,Fury_Stealth_Wing,Fury Stealth Wing,4,1000000,10,5,350,,1,4,0x000654E2,7,2,2,4,1,1,2,{ if((getequipid(EQI_HAND_R) ==3183 && (getequipid(EQI_HAND_R) ==3183 && (getequipid(EQI_HAND_L) ==3183 && (getequipid(EQI_HAND_L) ==3183 (getequipid(EQI_HAND_R) ==3189 && (getequipid(EQI_HAND_R) ==3189 && (getequipid(EQI_HAND_L) ==3189 && (getequipid(EQI_HAND_L) ==3189 (getequipid(EQI_HAND_R) ==3522 && (getequipid(EQI_HAND_R) ==3522 && (getequipid(EQI_HAND_L) ==3522 && (getequipid(EQI_HAND_L) ==3522 (getequipid(EQI_HAND_R) ==3528 && (getequipid(EQI_HAND_R) ==3528 && (getequipid(EQI_HAND_L) ==3528 && (getequipid(EQI_HAND_L) ==3528 (getequipid(EQI_HAND_R) ==3503 && (getequipid(EQI_HAND_R) ==3503 && (getequipid(EQI_HAND_L) ==3503 && (getequipid(EQI_HAND_L) ==3503 (getequipid(EQI_HAND_R) ==3509 && (getequipid(EQI_HAND_R) ==3509 && (getequipid(EQI_HAND_L) ==3509 && (getequipid(EQI_HAND_L) ==3509 (getequipid(EQI_HAND_R) ==25626 && (getequipid(EQI_HAND_R) ==25626 && (getequipid(EQI_HAND_L) ==25626 && (getequipid(EQI_HAND_L) ==25626)){ message strcharinfo(0),"Duel Wielding Royal Weapons Disables all Effects"; } else { bonus bAllStats,13; bonus2 bAddRace,RC_DemiHuman,15; }},{},{}

 

 

Thanks again, can i please make a request?

Its about Duel Wielding.

Can you please Disables all Effects if any of these weapon combination is used.

Items:
3183
3189
3522
3528
3503
3509
25626

Thanks again!

Tried this but it din't work.

Not working:
3528,Fury_Stealth_Wing,Fury Stealth Wing,4,1000000,10,5,350,,1,4,0x000654E2,7,2,2,4,1,1,2,{ if((getequipid(EQI_HAND_R) ==3183 && (getequipid(EQI_HAND_R) ==3183 && (getequipid(EQI_HAND_L) ==3183 && (getequipid(EQI_HAND_L) ==3183 (getequipid(EQI_HAND_R) ==3189 && (getequipid(EQI_HAND_R) ==3189 && (getequipid(EQI_HAND_L) ==3189 && (getequipid(EQI_HAND_L) ==3189 (getequipid(EQI_HAND_R) ==3522 && (getequipid(EQI_HAND_R) ==3522 && (getequipid(EQI_HAND_L) ==3522 && (getequipid(EQI_HAND_L) ==3522 (getequipid(EQI_HAND_R) ==3528 && (getequipid(EQI_HAND_R) ==3528 && (getequipid(EQI_HAND_L) ==3528 && (getequipid(EQI_HAND_L) ==3528 (getequipid(EQI_HAND_R) ==3503 && (getequipid(EQI_HAND_R) ==3503 && (getequipid(EQI_HAND_L) ==3503 && (getequipid(EQI_HAND_L) ==3503 (getequipid(EQI_HAND_R) ==3509 && (getequipid(EQI_HAND_R) ==3509 && (getequipid(EQI_HAND_L) ==3509 && (getequipid(EQI_HAND_L) ==3509 (getequipid(EQI_HAND_R) ==25626 && (getequipid(EQI_HAND_R) ==25626 && (getequipid(EQI_HAND_L) ==25626 && (getequipid(EQI_HAND_L) ==25626)){ message strcharinfo(0),"Duel Wielding Royal Weapons Disables all Effects"; } else { bonus bAllStats,13; bonus2 bAddRace,RC_DemiHuman,15; }},{},{}

&& should be || for most of that, your checking if its wearing any of those not all of those

Posted

Now I moved to herc, will that work there as well?


I just want the script to disable right or left hand if a player use any of the weapon combination below.
 
Items:
3183
3189
3522
3528
3503
3509
25626

Is it possible?
Posted (edited)
if ( isequippedcnt( 3183,3189,3522,3528,3503,3509,25626 ) == 1 ) { bonus bAllStats,13; bonus2 bAddRace,RC_DemiHuman,15; }

use isequippedcnt

 

lol just got home and was going to reply with this

Edited by Stolao

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...