Jump to content
  • 0

Request dynamic stats auto update script.


vijay30393

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

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
Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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

use isequippedcnt

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

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.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

Dump anyone?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

-    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;
    
}
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Onpcdieevent: it should be if kill > 0 not < 10 btw, logic error op

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

 

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   0
  • Joined:  05/10/12
  • Last Seen:  

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?
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

It should work fine, I'll write you a callfunc for the check when i get hone

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

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
Link to comment
Share on other sites

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.

×
×
  • Create New...