Jump to content

Fishing Script


Recommended Posts


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

Hey it's Danzai from eAthena, I'm moving my fishing script to here for everyone

Inorder to start fishing, you need the "Lure" item and "Small Fishing Rod" item
Variables/IDs:
2764 = Fishing Pole
2775 = Lure

For WPE/RPE Abuse Fix patch in this file to your server: changeset_r15442.diff

Fishing Script.txt

Edited by Skyrim
No need for [Tag] since it's your own script.
Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

nice. thx. ^^ how to duplicate to more fishing hole? and how to add extra one more item only can start fish? [Fisherman's Hat Item ID# 5317]

Edited by manabeast
Link to comment
Share on other sites


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

nice. thx. ^^ how to duplicate to more fishing hole? and how to add extra one more item only can start fish? [Fisherman's Hat Item ID# 5317]

like this.....

morocc,159,96,5 duplicate(School of Fish) School of Fish#1 742
morocc,159,96,5 duplicate(School of Fish) School of Fish#2 742
morocc,159,96,5 duplicate(School of Fish) School of Fish#3 742
morocc,159,96,5 duplicate(School of Fish) School of Fish#4 742

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

   	 }
       if (rand(1,3000) == 3) {
           getitem 617,1; //Old_Violet_Box
           mapannounce "brasilis","" + strcharinfo(0) + " has caught an Old Purple Box!!",bc_map,"0x44ff44";
       }
       end;
   }
   else {
       mes "Fish are swimming in the water.";
       close;
   }
}
       morocc,159,96,5 duplicate(School of Fish) School of Fish#1 742
       morocc,159,96,5 duplicate(School of Fish) School of Fish#2 742
       morocc,159,96,5 duplicate(School of Fish) School of Fish#3 742
       morocc,159,96,5 duplicate(School of Fish) School of Fish#4 742

add at where? erm... not working. about the another error i use the clone vs party script from you i found on eathena. this is other topic i pm you.

post-472-0-95545000-1324611508_thumb.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  967
  • Reputation:   53
  • Joined:  11/13/11
  • Last Seen:  

Hi Manabeast

Try this one

- script School of Fish#1:School of Fish 742,{

if (isequipped(2764)) && (isequipped(2775)){
specialeffect2 EF_BUBBLE;
set .@fcast,15;
if (isequipped(2550)) { //Fisher's_Muffler
set .@fcast,.@fcast - 3;
}
if (isequipped(2443)) { //Fish_Shoes
set .@fcast,.@fcast - 2;
}
progressbar "ffffff",.@fcast;
if (rand(1,20) == 2) {
getitem 6096,1; //Big Fish
specialeffect EF_BUBBLE;
mapannounce "brasilis","" + strcharinfo(0) + " has caught a Blue Fish!!!",bc_map,"0xff77ff";
end;
}
set .@rhea_ran,rand(1,70);
if (.@rhea_ran < 20) {
getitem 579,1; //Fresh Fish
}
else if (.@rhea_ran == 20) {
getitem 908,1; //Spawn
}
else if (.@rhea_ran == 21) {
getitem 909,1; //Jellopy
}
else if (.@rhea_ran == 22) {
getitem 963,1; //Sharp_Scale
}
else if (.@rhea_ran == 23) {
getitem 956,1; //Gill
}
else if (.@rhea_ran == 24) {
getitem 6049,1; //Marlin
}
else if (.@rhea_ran == 25) {
getitem 918,1; //Sticky_Webfoot
}
else if (.@rhea_ran == 26) {
getitem 960,1; //Nipper
}
else if (.@rhea_ran == 27) {
getitem 910,1; //Garlet
}
else if (.@rhea_ran == 28) {
getitem 938,1; //Sticky_Mucus
}
else if ((.@rhea_ran > 28) && (.@rhea_ran < 40)) {
getitem 624,1; //Rotten Fish
}
else {
mes "Nothing was caught.";
close;
}
if (rand(1,200) == 3) {
getitem 644,1; //Gift_Box
mapannounce "brasilis","" + strcharinfo(0) + " has caught a Gift Box!!",bc_map,"0x00ffff";
}
if (rand(1,500) == 3) {
getitem 603,1; //Old_Blue_Box
mapannounce "brasilis","" + strcharinfo(0) + " has caught an Old Blue Box!!",bc_map,"0x00ffff";
}
if (rand(1,3000) == 3) {
getitem 617,1; //Old_Violet_Box
mapannounce "brasilis","" + strcharinfo(0) + " has caught an Old Purple Box!!",bc_map,"0x44ff44";
}
end;
}
else {
mes "Fish are swimming in the water.";
close;
}
}
// Duplicate
morocc,159,96,5 duplicate(School of Fish) School of Fish#1 742
morocc,159,96,5 duplicate(School of Fish) School of Fish#2 742
morocc,159,96,5 duplicate(School of Fish) School of Fish#3 742
morocc,159,96,5 duplicate(School of Fish) School of Fish#4 742
morocc,159,96,5 duplicate(School of Fish) School of Fish#5 742

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


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

well. no fishing hole for me to click

post-472-0-17161800-1324619573_thumb.png

Link to comment
Share on other sites


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

i guess there might be something wrong with your script...

please check for the error....

brasilis,258,60,0 script School of Fish 723,{
if (isequipped(2764)) && (isequipped(2775)){
 specialeffect2 EF_BUBBLE;
 set .@fcast,15;
 if (isequipped(2550)) { //Fisher's_Muffler
  set .@fcast,.@fcast - 3;
 }
 if (isequipped(2443)) { //Fish_Shoes
  set .@fcast,.@fcast - 2;
 }
 progressbar "ffffff",.@fcast;
  if (rand(1,20) == 2) {
   getitem 6096,1; //Big Fish
   specialeffect EF_BUBBLE;
   mapannounce "brasilis","" + strcharinfo(0) + " has caught a Blue Fish!!!",bc_map,"0xff77ff";
   end;
  }
 set .@rhea_ran,rand(1,70);
 if (.@rhea_ran < 20) {
  getitem 579,1; //Fresh Fish
 }
 else if (.@rhea_ran == 20) {
  getitem 908,1; //Spawn
 }
 else if (.@rhea_ran == 21) {
  getitem 909,1; //Jellopy
 }
 else if (.@rhea_ran == 22) {
  getitem 963,1; //Sharp_Scale
 }
 else if (.@rhea_ran == 23) {
  getitem 956,1; //Gill
 }
 else if (.@rhea_ran == 24) {
  getitem 6049,1; //Marlin
 }
 else if (.@rhea_ran == 25) {
  getitem 918,1; //Sticky_Webfoot
 }
 else if (.@rhea_ran == 26) {
  getitem 960,1; //Nipper
 }
 else if (.@rhea_ran == 27) {
  getitem 910,1; //Garlet
 }
 else if (.@rhea_ran == 28) {
  getitem 938,1; //Sticky_Mucus
 }
 else if ((.@rhea_ran > 28) && (.@rhea_ran < 40)) {
  getitem 624,1; //Rotten Fish
 }
 else {
  mes "Nothing was caught.";
  close;
 }
 if (rand(1,200) == 3) {
  getitem 644,1; //Gift_Box
  mapannounce "brasilis","" + strcharinfo(0) + " has caught a Gift Box!!",bc_map,"0x00ffff";
 }
 if (rand(1,500) == 3) {
  getitem 603,1; //Old_Blue_Box
  mapannounce "brasilis","" + strcharinfo(0) + " has caught an Old Blue Box!!",bc_map,"0x00ffff";
 }
 if (rand(1,3000) == 3) {
  getitem 617,1; //Old_Violet_Box
  mapannounce "brasilis","" + strcharinfo(0) + " has caught an Old Purple Box!!",bc_map,"0x44ff44";
 }
 end;
}
else {
 mes "Fish are swimming in the water.";
 close;
}
}

brasilis,255,60,0 duplicate(School of Fish) School of Fish#1 723
brasilis,252,60,0 duplicate(School of Fish) School of Fish#2 723
brasilis,249,60,0 duplicate(School of Fish) School of Fish#3 723
brasilis,246,60,0 duplicate(School of Fish) School of Fish#4 723

this is another script i have modified for you....tested and working...

it will show you this in row....

1_shadow_npc.gif

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

well i try it's not working @@" see ss and i try change location see work or not.

testrz.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

^^ Looks like you forgot to tab. In your duplicates..Here's the syntax

<map name>,<x>,<y>,<facing>%TAB%duplicate(<label>)%TAB%<NPC Name>%TAB%<sprite id>,<triggerX>,<triggerY>

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  967
  • Reputation:   53
  • Joined:  11/13/11
  • Last Seen:  

Try using this

- script School of Fish#Fish1::Fish 742,{
if (isequipped(2764)) && (isequipped(2775)){
 specialeffect2 EF_BUBBLE;
  set .@fcast,15;
 if (isequipped(2550)) { //Fisher's_Muffler
  set .@fcast,.@fcast - 3;
 }
if (isequipped(2443)) { //Fish_Shoes
 set .@fcast,.@fcast - 2;
}
progressbar "ffffff",.@fcast;
if (rand(1,20) == 2) {
 getitem 6096,1; //Big Fish
 specialeffect EF_BUBBLE;
 mapannounce "brasilis","" + strcharinfo(0) + " has caught a Blue Fish!!!",bc_map,"0xff77ff";
 end;
}
set .@rhea_ran,rand(1,70);
if (.@rhea_ran < 20) {
 getitem 579,1; //Fresh Fish
} else if (.@rhea_ran == 20) {
 getitem 908,1; //Spawn
} else if (.@rhea_ran == 21) {
 getitem 909,1; //Jellopy
} else if (.@rhea_ran == 22) {
 getitem 963,1; //Sharp_Scale
} else if (.@rhea_ran == 23) {
 getitem 956,1; //Gill
} else if (.@rhea_ran == 24) {
 getitem 6049,1; //Marlin
} else if (.@rhea_ran == 25) {
 getitem 918,1; //Sticky_Webfoot
} else if (.@rhea_ran == 26) {
 getitem 960,1; //Nipper
} else if (.@rhea_ran == 27) {
 getitem 910,1; //Garlet
} else if (.@rhea_ran == 28) {
 getitem 938,1; //Sticky_Mucus
} else if ((.@rhea_ran > 28) && (.@rhea_ran < 40)) {
 getitem 624,1; //Rotten Fish
} else {
 mes "Nothing was caught.";
 close;
}
 if (rand(1,200) == 3) {
  getitem 644,1; //Gift_Box
  mapannounce "Event","" + strcharinfo(0) + " has caught a Gift Box!!",bc_map,"0x00ffff";
 }
 if (rand(1,500) == 3) {
  getitem 603,1; //Old_Blue_Box
  mapannounce "Event:","" + strcharinfo(0) + " has caught an Old Blue Box!!",bc_map,"0x00ffff";
 }
 if (rand(1,3000) == 3) {
  getitem 617,1; //Old_Violet_Box
  mapannounce "Event","" + strcharinfo(0) + " has caught an Old Purple Box!!",bc_map,"0x44ff44";
 }
end;
} else {
 mes "Fish are swimming in the water.";
 close;
}
}
brasilis,258,60,0 duplicate(Fish) School of Fish#Fish1 723
brasilis,255,60,0 duplicate(Fish) School of Fish#Fish2 723
brasilis,252,60,0 duplicate(Fish) School of Fish#Fish3 723
brasilis,249,60,0 duplicate(Fish) School of Fish#Fish4 723
brasilis,246,60,0 duplicate(Fish) School of Fish#Fish5 723

Link to comment
Share on other sites


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

Oh wow...I didnt realize people would actually use this x3

Since i made the script; anything I can help you with?

Mana, to add a new item to start fishing you edit this

if (isequipped(2764)) && (isequipped(2775)){
 specialeffect2 EF_BUBBLE;
 set .@fcast,20;
 if (isequipped(2550)) { //Fisher's_Muffler
  set .@fcast,.@fcast - 2;
 }
 if (isequipped(2443)) { //Fish_Shoes
  set .@fcast,.@fcast - 2;
 }
 if (isequipped(2764)) { //Small_Fishing_Rod
  set .@fcast,.@fcast - 3;
 }
 if (isequipped(2775)) { //Lure
  set .@fcast,.@fcast - 1;
 }

Make it into

if (isequipped(2764)) && (isequipped(2775)) && (isequipped(5317)){

Edited by Skyrim
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

@arcenciel@ oh... need add tab in there . this forum disable the tab x.x"

@keikun@ ok i try this.

@Skyrim@ oh ya. for ppl no much like pvp this one suit them and me =). what is the second line there

  if (isequipped(2550)) { //Fisher's_Muffler
  set .@fcast,.@fcast - 2;
 }
 if (isequipped(2443)) { //Fish_Shoes
  set .@fcast,.@fcast - 2;
 }
 if (isequipped(2764)) { //Small_Fishing_Rod
  set .@fcast,.@fcast - 3;
 }
 if (isequipped(2775)) { //Lure
  set .@fcast,.@fcast - 1;

?? this make them reduce casting time? how to set one?

Edited by manabeast
Link to comment
Share on other sites


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

Basically put this

if (isequipped(ITEM ID)) { //ITEM NAME

set .@fcast,.@fcast - #;// Number of seconds to reduce

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

hey, it's working i using keikun and put tab on it only work. >.<" tab problem

i attach the working script for multi hole. erm. skyrim can put put at front if ppl wan download easy? XD!

@have script wan asking.(what's difference from those two? and where to set get rate? like 50% fishing will get item?)

1) else if ((.@rhea_ran > 28) && (.@rhea_ran < 40)) {

getitem 624,1; //Rotten Fish

}

2) if (rand(1,200) == 3) {

getitem 644,1; //Gift_Box

mapannounce "brasilis","" + strcharinfo(0) + " has caught a Gift Box!!",bc_map,"0x00ffff";

Fishing Script.txt

Link to comment
Share on other sites


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

like 50% fishing will get item?

something like this

if( rand(100) < 50 ) getitem 644,1;

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

well. i still not really get how to set the item want get from fishing. hmm... error?

post-472-0-78200300-1325396014_thumb.png

Fishing Script.txt

post-472-0-60601600-1325396430_thumb.png

Link to comment
Share on other sites


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

you didnt close your Bracket correctly...

Example


if(  variable < 100 ) getitem 501,1;
else if( variable > 100 && variable < 150 ) getitem 607,1;
else if( variable > 150 && variable < 200 ) getitem 607,2;
else if( variable > 200 && variable < 250 ) getitem 607,3;
else getitem 512,1;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

............. i'm dunno scriptor not really understand what you mean. :D last time u say this is if( rand(100) < 50 ) getitem "ID" ,"rate%"; drop rate. now this one is? drop rate which one? if i wan put more add more link to continue 4,5,6,7..... ?

if( variable < 100 ) getitem 501,1;

else if( variable > 100 && variable < 150 ) getitem "ID",1;

else if( variable > 150 && variable < 200 ) getitem "ID",2;

else if( variable > 200 && variable < 250 ) getitem "ID",3;

else getitem "ID(if fail no get rare item get this?),1;

Link to comment
Share on other sites


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

if( rand(100) < 50 ) getitem "ID" ,"rate%";

the rand(100) will generate a number within 0 ~ 99 ...

when i compare the rand(100) result with 50...

if the value generated is above 50...then he get nothing since i only compare if the value is lesser than 50 then only he will receive an items...

Extra : Conditional

getitem ID,Rate ???

there is not Rate Configuration inside the GetItem command..

it is

getitem ItemID,Amount;

if( variable < 100 ) getitem 501,1;

else if( variable > 100 && variable < 150 ) getitem "ID",1;

else if( variable > 150 && variable < 200 ) getitem "ID",2;

else if( variable > 200 && variable < 250 ) getitem "ID",3;

else getitem "ID(if fail no get rare item get this?),1;

This is just an example i give if you are going to set Different Rate for each items gaining...

it can be done like this

if( rand(300) < 100 ) getitem ID,Amount;  // If Randomed below 100

else getitem ID,Amount; // above 249


Anyway...

if you are going to give randomed items without a Fixed Rate...

you can do it in this way..

Group the items using Array

setarray .ItemList[0],501,502,503,504;

To get item Randomly from the Array

getitem .ItemList[ rand( getarraysize( .ItemList ) ) ],1;

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


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

it's hard to understand but i starting to get little what u mean >.<

1.oh, that one is generate random inside 100. over 50 get item,below 50 nothing get.

2.too long ~.~" (my English not really good alot not understand nvm this one)

3.ya, this one just for get item but not what i want. - -" i want put rare item lower rate.

4.

if( rand(300) < 100 ) getitem ID,Amount; // If Randomed below 100

else if( rand(300) > 100 && rand(300) < 150 ) getitem ID,Amount; // If Randomed between 100 ~ 149

else if( rand(300) > 150 && rand(300) < 200 ) getitem ID,Amount; // If Randomed between 150 ~ 199

else if( rand(300) > 200 && rand(300) < 250 ) getitem ID,Amount; // If Randomed between 200 ~ 249

else if( rand(300) > 250 && rand(300) < 300 ) getitem ID,Amount; // If Randomed between 250 ~ 299

else if( rand(300) > 300 && rand(300) < 350 ) getitem ID,Amount; // If Randomed between 300 ~ 349

else getitem ID,Amount; // above 349

-mean if i want put more item format should put like this? what if the item same rate?

-the higher rate easy get item or lower rate easy get item? what if i want set rare item?

Link to comment
Share on other sites


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

:D

the rand( 300 ) just a command for the server to generate a number randomly between 0 ~ 300 ( you specified 300 in this case )

if you put rand( 1000 ) then it will generate randomly between 0 ~ 1000

Wiki : Rand

*rand(<number>{,<number>});
This function returns a number ...
(if you specify one) ... randomly positioned between 0 and the number you specify -1.
(if you specify two) ... randomly positioned between the two numbers you specify.
rand(10)  would result in 0,1,2,3,4,5,6,7,8 or 9
rand(0,9) would result in 0,1,2,3,4,5,6,7,8 or 9
rand(2,5) would result in 2,3,4 or 5


Do you really know/understand what does a IF-ELSE Statement does ?????

if( Contition = True ) {  
All Process is here if Condition True...
}else{
All process goes here when Condition is not Matched / False
}

Example from Doc :

*if (<condition>) <statement>;
This is the basic conditional statement command, and just about the only one
available in this scripting language.
The condition can be any expression. All expressions resulting in a non-zero
value will be considered True, including negative values. All expressions
resulting in a zero are false.
If the expression results in True, the statement will be executed. If it isn't
true, nothing happens and we move on to the next line of the script.
if (1)  mes "This will always print.";
if (0)  mes "And this will never print.";
if (5)  mes "This will also always print.";
if (-1) mes "Funny as it is, this will also print just fine.";
For more information on conditional operators see the operators section above.
Anything that is returned by a function can be used in a condition check without
bothering to store it in a specific variable:
if (strcharinfo(0)=="Daniel Jackson") mes "It is true, you are Daniel!";
More examples of using the 'if' command in the real world:
Example 1:
	set @var1,1;
	input @var2;
	if(@var1==@var2) goto L_Same;
	mes "Sorry that is wrong";
	close;
L_Same:
	close;
Example 2:

set @var1,1;
input @var2;
if(@var1!=@var2) mes "Sorry that is wrong";
close;
(Notice examples 1 and 2 have the same effect.)
Example 3:
set @var1,@var1+1;
mes "[Forgetfull Man]";
if (@var==1) mes "This is the first time you have talked to me";
if (@var==2) mes "This is the second time you have talked to me";
if (@var==3) mes "This is the third time you have talked to me";
if (@var==4) mes "This is the forth time you have talked to me, but I think I am getting amnesia, I have forgotten about you";
if (@var==4) set @var,0;
close;
Example 4:
	mes "[Quest Person]";
	if(countitem(512)>=1) goto L_GiveApple;
	// The number 512 was found from item_db, it is the item number for the Apple.
	mes "Can you please bring me an apple?";
	close;
L_GiveApple:
	mes "Oh an apple, I didn't want it, I just wanted to see one";
	close;
Example 5:
	mes "[Person Checker]";
	if($name$!=null) goto L_Check;
	mes "Please tell me someones name";
	next;
	input $name$;
	set $name2$,strcharinfo(0);
	mes "[Person Checker]";
	mes "Thank you";
L_Check:
	if($name$==strcharinfo(0) ) goto L_SameName;
	mes "[Person Checker]";
	mes "You are not the person that " +$name2$+ " mentioned";
L_End:
	set $name$,null;
	set $name2$,null;
	close;
L_SameName:
	mes "[Person Checker]";
	mes "You are the person that " +$name2$+ " just mentioned";
	mes "nice to meet you";
	goto L_End;
See 'strcharinfo' for explanation of what this function does.
Example 6: Using complex conditions.
	mes "[Multi Checker]";
	if( (@queststarted==1) && (countitem(512)>=5) ) goto L_MultiCheck;
	// Only if the quest has been started AND You have 5 apples will it goto "L_MultiCheck"
	mes "Please get me 5 apples";
	set @queststarted,1;
	close;
L_MultiCheck:
	mes "[Multi Checker]";
	mes "Well done you have started the quest of got me 5 apples";
	mes "Thank you";
	set @queststarted,0;
	delitem 512,5;
	close;
With the Advanced scripting engine, we got nested if's. That is:
if (<condition>)
dothis;
else
dothat;

If the condition doesn't meet, it'll do the action following the else.
We can also group several actions depending on a condition, the following way:
if (<condition)
{
dothis1;
dothis2;
dothis3;
} else {
dothat1;
dothat2;
dothat3;
dothat4;
}
Remember that if you plan to do several actions upon the condition being false, and
you forget to use the curly braces (the { } ), the second action will be executed regardless
the output of the condition, unless of course, you stop the execution of the script if the
condition is true (that is, in the first grouping using a return; , and end; or a close; )
Also, you can have multiple conditions nested or chained, and don't worry about limits as to
how many nested if you can have, there is no spoon 
...
if (<condition 1>)
dothis;
else if (<condition 2>)
{
dotheother;
do that;
end;
} else
do this;
...


In above case....the IF-ELSE Statement check for 2 Condition before the following process if carried out....

else if( rand(300) > 100 && rand(300) < 150 ) getitem ID,Amount; // If Randomed between 100 ~ 149

When the rand(300) generated a Number inside the range of 101 ~ 149 ... the Condition is TRUE...coz it is Bigger than 100 and it is Smaller than 150

On the other hand.....

between 101 ~ 149 there are about 49 numbers ........

which mean...

the rate is..

49 / 300


Jesus..i cant believe i really spend time on explaination stuffs....>.< i damn suck in Explanation summore....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  138
  • Topics Per Day:  0.03
  • Content Count:  835
  • Reputation:   25
  • Joined:  11/22/11
  • Last Seen:  

Remove. = =" so sorry my slow understand making the topic out.

:D to emistry

@mod@ :D

Edited by manabeast
Link to comment
Share on other sites


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

Erm...after i looking this again...i just wonder i made a mistake.....

we cant have more than 1 rand( value ) inside the same condition checking ...otherwise...this will spoil your rate checking...

Well, i try make it simple this time...


set .Random,rand( 1000 );
if( .Random <= 100 ) getitem 607,1;
else if( .Random <= 150 && .Random > 100 ) getitem 607,2;
else if( .Random <= 200 && .Random > 150 ) getitem 607,2;
else if( .Random <= 250 && .Random > 200 ) getitem 607,2;
else getitem 512,1;


In this case...

set .Random,rand( 1000 );

just like what i told you in previous posts..

first and foremost, this will generate a Number Randomly from 0 ~ 999

else if( .Random <= 150 && .Random > 100 ) getitem 607,2;
else if( .Random <= 200 && .Random > 150 ) getitem 607,2;
else if( .Random <= 250 && .Random > 200 ) getitem 607,2;

Here...we will check for the Probability of items gaining...

For Example the 1st line :

else if( .Random <= 150 && .Random > 100 ) getitem 607,2;

A User/Player will gain the Items once the .Random that generated is in the range of 101 ~ 150

else if( .Random <= 200 && .Random > 150 ) getitem 607,2;

A User/Player will gain the Items once the .Random that generated is in the range of 151 ~ 200

else if( .Random <= 250 && .Random > 200 ) getitem 607,2;

A User/Player will gain the Items once the .Random that generated is in the range of 201 ~ 250

else getitem 512,1;

This... will only RUN when all the above Probability not matched / .Random are not inside the range...


Well, i guess i will stop explaining after this posts right here...since this topic is Script Release Section...not Script Support Section.

If you still have any Enquiries , please open a new thread in Script Support Section, otherwise i might be targeted by Mod for Flooding this Topic...

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

This section is NOT a support section!

Please follow this guideline...

  • Upvote 3
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...