Jump to content
  • 0

help me with this script


Byakuran

Question


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

how can i add time in this? like they will have the title and bonus stats for 7days.

 

heres my script

prontera,150,150,4 script Slayer Title 54,{
mes "Would you like to become Dragon Slayer or Demon Slayer?";
next;
switch(select("Yes:No.")) {
case 1:
mes "Select what you want to become";
switch(select("Dragon Slayer:Demon Slayer")) {
case 1:
if(countitem(7777) > 0) {
delitem 7777,1;
atcommand "@fakename [Dragon Slayer] "+ strcharinfo(0);
mes "Congrats You've become Dragon Slayer";
close;
}
else {
mes "You don't have any requirements for Dragon Slayer or Demon Slayer.";
mes "Come back when you get one.";
close;
}
 
case 2:
if(countitem(7778) > 0) {
delitem 7778,1;
atcommand "@fakename [Demon Slayer] "+ strcharinfo(0);
mes "Congrats You've become Demon Slayer";
close;
}
else {
mes "You don't have any requirements for Dragon Slayer or Demon Slayer.";
mes "Come back when you get one.";
close;
}
}
 
case 2:
mes "Very well, I shall be here if you change your mind.";
close;
}
}
Link to comment
Share on other sites

16 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

support ...

use *addtimer script command upon execution which return their name afterwards ...

also make OnPCLoginEvent with *addtimer whenever they login ...

and search around OnPCStatCalcEvent to get a permanent bonus

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

support ...

use *addtimer script command upon execution which return their name afterwards ...

also make OnPCLoginEvent with *addtimer whenever they login ...

and search around OnPCStatCalcEvent to get a permanent bonus

 

thanks gonna try it .. i

i'm having an error.

 

its having an error on "

 

addtimer 5000, atcommand "@fakename [Dragon Slayer] "+ strcharinfo(0);
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,155,180,5	script	kjdhfskjdh	100,{

atcommand "@fakename [kakaka] "+ strcharinfo(0);

addtimer 5000, strnpcinfo(0) +"::Onlalala";

end;

Onlalala:

atcommand "@fakename";

end;

}

refer to .... wiki ... lol ... I just noticed wiki there also doesn't have example lol
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

prontera,155,180,5	script	kjdhfskjdh	100,{
	atcommand "@fakename [kakaka] "+ strcharinfo(0);
	addtimer 5000, strnpcinfo(0) +"::Onlalala";
	end;
Onlalala:
	atcommand "@fakename";
	end;
}
refer to .... wiki ... lol ... I just noticed wiki there also doesn't have example lol

 

 

i already change the dragon slayer but after it change its name it also back to original name

 

heres the code

prontera,150,150,4 script Dragon Slayer 54,{
mes "Would you like to become Dragon Slayer or Demon Slayer?";
next;
switch(select("Yes:No.")) {
case 1:
mes "Select what you want to become";
switch(select("Dragon Slayer:Demon Slayer")) {
case 1:
if(countitem(7777) > 0) {
delitem 7777,1;
atcommand "@fakename [Dragon Slayer] "+ strcharinfo(0);
addtimer 10000, strnpcinfo(0)+"::Ontitle";
Ontitle:
atcommand "@fakename";
close;
}
else {
mes "You don't have any requirements for Dragon Slayer or Demon Slayer.";
mes "Come back when you get one.";
close;
}
 
case 2:
if(countitem(7778) > 0) {
delitem 7778,1;
atcommand "@fakename [Demon Slayer] "+ strcharinfo(0);
mes "Congrats You've become Demon Slayer";
close;
}
else {
mes "You don't have any requirements for Dragon Slayer or Demon Slayer.";
mes "Come back when you get one.";
close;
}
}
 
case 2:
mes "Very well, I shall be here if you change your mind.";
close;
}
}

I forgot to add close and end in addtimer.. already solved for time.. 

 

how about OnPCLoginEvent for bonus stats??

Edited by Byakuran
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

atcommand "@fakename [Dragon Slayer] "+ strcharinfo(0);

addtimer 10000, strnpcinfo(0)+"::Ontitle";

close; // <--- end the script

Ontitle:

atcommand "@fakename";

end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

atcommand "@fakename [Dragon Slayer] "+ strcharinfo(0);
addtimer 10000, strnpcinfo(0)+"::Ontitle";
close; // <--- end the script
Ontitle:
atcommand "@fakename";
end;

thanks i forgot to put that..

 

i try to add OnPCLoginEvent for stats bonus but i don't get any stat heres the script ..

 

- script login -1,{
OnPCLoginEvent:
if (#dragonslayer == 1) {
bonus bStr,5;
}
}

Another Problem: when i logout even theres still time my name back to normal when i login

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

i try to add OnPCLoginEvent for stats bonus but i don't get any stat heres the script ..

OnPCStatCalcEvent

OnPCStatCalcEvent:

if ( #dragonslayer )

bonus bstr, 1;

end;

Problem: when i logout even theres still time my name back to normal when i login

OnPCLoginEvent:

if ( !#dragonslayer ) end;

if ( #dragonslayer + 10 < gettimetick(2) )

atcommand "@fakename ...

else

#dragonslayer = 0;

...

something like this

just so you know whats gettimetick(2) doing over there

http://rathena.org/wiki/Timers_(Scripting)#Use_Number_3:_Deny_Usage

Edit, I remember I did something like this before ...

http://www.eathena.ws/board/index.php?s=&showtopic=236859&view=findpost&p=1291466

just instead of your @fakename, I used @adjgmlvl ...

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

 

i try to add OnPCLoginEvent for stats bonus but i don't get any stat heres the script ..

OnPCStatCalcEvent

OnPCStatCalcEvent:

if ( #dragonslayer )

bonus bstr, 1;

end;

Problem: when i logout even theres still time my name back to normal when i login

OnPCLoginEvent:

if ( !#dragonslayer ) end;

if ( #dragonslayer + 10 < gettimetick(2) )

atcommand "@fakename ...

else

#dragonslayer = 0;

...

something like this

just so you know whats gettimetick(2) doing over there

http://rathena.org/wiki/Timers_%28Scripting%29#Use_Number_3:_Deny_Usage

 

 

so for fakename i need to change again the script? or i'll just add those script you said?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

the part made in post#6 needs to add

#dragonslayer = gettimetick(2);

if you refer my script there I'm sure you can write

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

the part made in post#6 needs to add

#dragonslayer = gettimetick(2);

if you refer my script there I'm sure you can write

 

thanks.. but is the time in gettimetick(2) seconds not milliseconds?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

yes in seconds

#dragonslayer = gettimetick(2) + 10; // 10 seconds

addtimer 10000, strnpcinfo(0)+"::OnLabel"; // 10 seconds

...

set .time, 10;

#dragonslayer = gettimetick(2) + .time;

addtimer .time * 1000, strnpcinfo(0)+"::OnLabel";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

yes in seconds

#dragonslayer = gettimetick(2) + 10; // 10 seconds

addtimer 10000, strnpcinfo(0)+"::OnLabel"; // 10 seconds

...

set .time, 10;

#dragonslayer = gettimetick(2) + .time;

addtimer .time * 1000, strnpcinfo(0)+"::OnLabel";

 

i'm getting error in this one 

 set #dragonslayer = gettimetick(2) + 60;

can i just use this ?

 set #dragonslayer, gettimetick(2) + 60;

EDIT: i try this

set #dragonslayer, gettimetick(2) + 60;

 

but when i try to logout then login again i get my original name again.

Edited by Byakuran
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

okay ... but I didn't see a flag that "Remove when change map"

OnPCStatCalcEvent: if ( strcharinfo(3) == "guild_vs3" ) ....

this is still the only way to add buff when stay in specific map ...

and it couldn't stack ... that's bad

what happens if there's 2 different script also add bonus bstr ...

anyway I already feel like feeding already

prontera,150,180,4	script	Slayer Title	54,{
	mes "Would you like to become Dragon Slayer or Demon Slayer?";
	next;
	if ( select ( "Yes", "No" ) == 2 ) {
		mes "Very well, I shall be here if you change your mind.";
		close;
	}
	mes "Select what you want to become";
	.@s = select( "Dragon Slayer", "Demon Slayer" ) -1;
	if ( countitem(7777) ) {
		delitem 7777, 1;
		atcommand "@fakename ["+ .title$[.@s] +"] "+ strcharinfo(0);
		bonus_script "{ bonus bStr, 5000; }", .buff_last, 8;
		addtimer .buff_last * 1000, strnpcinfo(0) +"::Onresettitle";
		mes "Congrats You've become "+ .title$[.@s];
		player_title$ = gettimetick(2) +"#"+ .@s;
	}
	else {
		mes "You don't have any requirements for Dragon Slayer or Demon Slayer.";
		mes "Come back when you get one.";
	}
	close;
OnInit:
	setarray .title$, "Dragon Slayer", "Demon Slayer";
	.buff_last = 30; // last 10 seconds
	end;
OnPCLoginEvent:
	if ( player_title$ == "" ) end;
//	dispbottom player_title$ +"~"+ gettimetick(2);
	explode .@player_title$, player_title$, "#";
	.@time = atoi( .@player_title$[0] );
	.@title = atoi( .@player_title$[1] );
	if ( .@time < gettimetick(2) ) {
		.@timeleft = gettimetick(2) - .@time;
		atcommand "@fakename ["+ .title$[.@title] +"] "+ strcharinfo(0);
		bonus_script "{ bonus bStr, 5000; }", .@timeleft, 8;
		addtimer .@timeleft * 1000, strnpcinfo(0) +"::Onresettitle";
	}
	else
		player_title$ = "";
	end;
Onresettitle:
	atcommand "@fakename";
	player_title$ = "";
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  110
  • Topics Per Day:  0.02
  • Content Count:  229
  • Reputation:   5
  • Joined:  12/16/11
  • Last Seen:  

okay ... but I didn't see a flag that "Remove when change map"

OnPCStatCalcEvent: if ( strcharinfo(3) == "guild_vs3" ) ....

this is still the only way to add buff when stay in specific map ...

and it couldn't stack ... that's bad

what happens if there's 2 different script also add bonus bstr ...

anyway I already feel like feeding already

prontera,150,180,4	script	Slayer Title	54,{
	mes "Would you like to become Dragon Slayer or Demon Slayer?";
	next;
	if ( select ( "Yes", "No" ) == 2 ) {
		mes "Very well, I shall be here if you change your mind.";
		close;
	}
	mes "Select what you want to become";
	.@s = select( "Dragon Slayer", "Demon Slayer" ) -1;
	if ( countitem(7777) ) {
		delitem 7777, 1;
		atcommand "@fakename ["+ .title$[.@s] +"] "+ strcharinfo(0);
		bonus_script "{ bonus bStr, 5000; }", .buff_last, 8;
		addtimer .buff_last * 1000, strnpcinfo(0) +"::Onresettitle";
		mes "Congrats You've become "+ .title$[.@s];
		player_title$ = gettimetick(2) +"#"+ .@s;
	}
	else {
		mes "You don't have any requirements for Dragon Slayer or Demon Slayer.";
		mes "Come back when you get one.";
	}
	close;
OnInit:
	setarray .title$, "Dragon Slayer", "Demon Slayer";
	.buff_last = 30; // last 10 seconds
	end;
OnPCLoginEvent:
	if ( player_title$ == "" ) end;
//	dispbottom player_title$ +"~"+ gettimetick(2);
	explode .@player_title$, player_title$, "#";
	.@time = atoi( .@player_title$[0] );
	.@title = atoi( .@player_title$[1] );
	if ( .@time < gettimetick(2) ) {
		.@timeleft = gettimetick(2) - .@time;
		atcommand "@fakename ["+ .title$[.@title] +"] "+ strcharinfo(0);
		bonus_script "{ bonus bStr, 5000; }", .@timeleft, 8;
		addtimer .@timeleft * 1000, strnpcinfo(0) +"::Onresettitle";
	}
	else
		player_title$ = "";
	end;
Onresettitle:
	atcommand "@fakename";
	player_title$ = "";
	end;
}

 

thanks but i don't understand this one

.buff_last = 30; // last 10 seconds
it says last 10secs but its value is 30?
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

lol I keep change the value for testing

yeah it should be 30 seconds

.buff_last = 30; // last 30 seconds
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...