Jump to content

Utility: Selection Buffer


Skorm

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

Selection Buffer


This is just a buffer NPC that I made for someone in the script request section. It's pretty versatile and sturdy so instead of it being depreciated I thought others might use it.

Description:

Select from a list of buffs the ones you want to purchase each time you buff. Double click to reselect buffs.

Everything is stored in one character variable.

optimized.gif

( preview slowed to increase loading times )


  • Submitter
  • Submitted
    08/05/2014
  • Category
  • Video
  • Content Author
    Skorm

 

  • Upvote 1
  • Love 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   136
  • Joined:  02/26/14
  • Last Seen:  

What's to stop people from Warping upon getting the buff and not having to pay?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  554
  • Reputation:   14
  • Joined:  09/24/12
  • Last Seen:  

Perfect idea..  ^ ^

Keep it up sir 

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

What's to stop people from Warping upon getting the buff and not having to pay?

 

That's just the buff selection window... You don't pay anything there. You just select the buffs you'd like to purchase when clicking the npc. The buffs and money are taken with one click, in other words that isn't a problem.

 

Perfect idea.. ^ ^

Keep it up sir

Thanks I'm glad you like it although the idea isn't entirely mine.

 

Original idea here http://rathena.org/board/topic/96963-custom-buffer/

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  554
  • Reputation:   14
  • Joined:  09/24/12
  • Last Seen:  

 

CheckMate, on 06 Aug 2014 - 09:57 AM, said:

snapback.png

Perfect idea.. ^ ^

Keep it up sir

Thanks I'm glad you like it although the idea isn't entirely mine.

 

Original idea here http://rathena.org/b...-custom-buffer/

 

 

 

Ooo.. But it ok sir.... Since you can elaborate the script to be more perfect and share it.. That a nice in you... I wish i can be scripter like you too... /sigh

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

prontera,158,156,4 script Pay for Buff 100,{
if( @h_last > gettimetick(2) || !slc_bufs ) goto Set_Buffs;
set @h_last, gettimetick(2)+5;


.@total = callsub(Sub_PriceCheck);


if( .@total > Zeny ) {
message strcharinfo(0), "You don't have enough zeny to buff double click the buffer to modify your selection.";
end;
}


for( .@a = 0; .@a < .len; .@a++ )
if( ( slc_bufs & pow( 2, .@a ) ) ) {
skilleffect .skil_num[.@a], .levels[.@a];
sc_start .sc_effect[.@a], .ticks[.@a], .levels[.@a];
message strcharinfo(0),"Buff "+.skil_txt$[.@a]+" Added!";
}
Zeny = Zeny - .@total;
end;


Sub_PriceCheck:
for( .@a = 0; .@a < .len; .@a++ )
if( ( slc_bufs & pow( 2, .@a ) ) )
.@total = .@total + .price[.@a];
return .@total;


Set_Buffs:
.@slc_bufs = slc_bufs;
.@total = callsub(Sub_PriceCheck);


function sf {
function s;
.@a = getarg(2);
.@len = getarg(3);
return (
sprintf( getarg(0),
s(.@a, .@len, getarg(1), getarg(4), getarg(5)), s(.@a++, .@len, getarg(1), getarg(4), getarg(5)),
s(.@a++, .@len, getarg(1), getarg(4), getarg(5)), s(.@a++, .@len, getarg(1), getarg(4), getarg(5)),
s(.@a++, .@len, getarg(1), getarg(4), getarg(5)), s(.@a++, .@len, getarg(1), getarg(4), getarg(5)), 
s(.@a++, .@len, getarg(1), getarg(4), getarg(5)), s(.@a++, .@len, getarg(1), getarg(4), getarg(5)), 
s(.@a++, .@len, getarg(1), getarg(4), getarg(5)), s(.@a++, .@len, getarg(1), getarg(4), getarg(5))
)
+(( .@a+1 < .@len )?":Next":":")
+(( .@a-11 > 0 )?":Back":":")
+":Done:Cancel"
);
function s {
if( getarg(0) >= getarg(1) ) return "";
else {
.@name$ = getelementofarray( getarg(2), getarg(0) );
return .@name$==""?"":"Buff [ ^0054ff"+.@name$+"^000000 ] Lv"+getelementofarray( getarg(4), getarg(0) )+" [ "+(getarg(3)&pow(2,getarg(0))?"^35a100On":"^FF0000Off")+"^000000 ]";
}
};
};
function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); };
function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); };


mes .npc_nm$;
mes "Select your buffs!";
next;
.@a = 0;
while( 1 ) {
select( sf( .format$, .skil_txt$, .@a, .len, .@slc_bufs, .levels ) );
switch( @menu ) {
case 11: .@a = nex( .@a, .len ); break;
case 12: .@a = bac( .@a ); break;
case 13: 
mes .npc_nm$;
mes "Alright, your current total will be "+.@total+"z each time you use my buffing service. Is that ok?";
next;
if( select("Yes:No") == 1 )
slc_bufs = .@slc_bufs;
case 14: end;


default:
.@select = .@a+@menu-1;
if( ( .@slc_bufs & pow( 2, .@select ) ) ) {
.@slc_bufs = .@slc_bufs - pow( 2, .@select );
.@total = .@total - .price[.@select];
} else {
.@slc_bufs = .@slc_bufs + pow( 2, .@select );
.@total = .@total + .price[.@select];
}
}
}
end;


OnInit:
.npc_nm$ = "[ "+strnpcinfo(1)+" ]";
setarray .sc_effect, SC_CP_WEAPON, SC_CONCENTRATE, SC_ASSUMPTIO, SC_TRUESIGHT, SC_MAXOVERTHRUST, SC_AUTOCOUNTER, SC_PROVIDENCE;
setarray .skil_txt$, "Full Protection Lv5", "Attention Concentrate Lv10",  "Assumptio Lv 5",  "True Sight Lv 10",  "Maximum Over Thrust Lv5",  "Auto Guard Lv10",  "Providence Lv 5";
setarray .ticks,     300000,         300000,      300000,       300000,       300000,     300000,        300000;
setarray .price,     1000000,           3000000,        1000000,         3000000,         3000000,       3000000,         1000000;
setarray .skil_num,  479,             45,          361,          380,           486,         249,            256;
setarray .levels,    5,             10,          5,            10,            5,         10,             5;
.format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
.len = getarraysize(.sc_effect);
end;
}

So I changed the skills it does, but then after the NPC cast the buffs on me. My character cannot move nor sit down.

 

 

Which buff skill makes my character not move?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

So I changed the skills it does, but then after the NPC cast the buffs on me. My character cannot move nor sit down.

 

 

Which buff skill makes my character not move?

 

Lol Maybe auto counter? Or this SC_CP_WEAPON?

Link to comment
Share on other sites

  • 4 years later...

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  333
  • Reputation:   67
  • Joined:  09/05/12
  • Last Seen:  

On 8/15/2014 at 11:58 AM, Skorm said:

 

Lol Maybe auto counter? Or this SC_CP_WEAPON?

Why is the first selection is doubled and don't show the last selection?
It happens when I used hash a12f1ce.
1.png.6ac5562e920ad8d8f5d34792186cd73a.png
Back then when I'm using r17704, the selection is good without this problem.
Any solution in this? Thanks.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

14 hours ago, GodKnows Jhomz said:

Why is the first selection is doubled and don't show the last selection?
It happens when I used hash a12f1ce.
1.png.6ac5562e920ad8d8f5d34792186cd73a.png
Back then when I'm using r17704, the selection is good without this problem.
Any solution in this? Thanks.

Thanks for letting me know I've got a fix I'll upload it when I get home from work.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   2
  • Joined:  08/15/18
  • Last Seen:  

[Error]: script_rid2sd: fatal error ! player not attached!
[Debug]: Function: setarray (8 parameters):
[Debug]: Data: variable name='.sc_effect' index=0
[Debug]: Data: variable name='SC_INCREASEAGI' index=0
[Debug]: Data: number value=30
[Debug]: Data: number value=115
[Debug]: Data: number value=35
[Debug]: Data: number value=29
[Debug]: Data: number value=40
[Debug]: Data: number value=41
[Debug]: Source (NPC): Buffer at prontera (157,162)


@edit
Fixed

Edited by Thinker
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

@Skorm I have a suggestion for this one. since you need to  talk to the npc to setup which of those buffs you want to be enabled. why not  make a command where players can use it anywhere anytime. but that checks if they have the right amount of zeny.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

14 hours ago, Radian said:

@Skorm I have a suggestion for this one. since you need to  talk to the npc to setup which of those buffs you want to be enabled. why not  make a command where players can use it anywhere anytime. but that checks if they have the right amount of zeny.

I like that idea. I also wanted to add an option where you could split the npcs up. So one for changing buffs and one for setting buffs since double-clicking is a little dodgy.

Edit: @Radian Done.

Edited by Skorm
  • Upvote 1
  • Love 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

4 hours ago, Skorm said:

Edit: @Radian Done.

Nice works perfectly. Thank you ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

how to make this buff read guild id???

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
Reply to this topic...

×   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...