Eross Posted June 19, 2020 Group: Members Topic Count: 166 Topics Per Day: 0.09 Content Count: 377 Reputation: 12 Joined: 04/05/20 Last Seen: 3 hours ago Share Posted June 19, 2020 Hi ! how to make this quest board restrict only one character per account ??????? it seems like all character in one account can take quests -_- //===== rAthena Script ======================================= //= tr0n's Questboard //===== By: ================================================== //= tr0n //===== Current Version: ===================================== //= 1.6.6 //===== Description: ========================================= //= Easily add collection and hunting quests. //===== Changelogs: ========================================== // 1.0.0 Release // 1.1.0 Added zeny reward // 1.2.0 Rewrote checkmob and killcounter // 1.3.1 Added level restriction // 1.3.4 Added Reward Item Amount // 1.4.4 Added Quest delay // 1.5.4 Added repeatable Quests // 1.6.4 Added party support // 1.6.5 Bug fixes for party support // 1.6.6 Bug fixes for delay time does not appear [mazvi] //============================================================ malaya,237,202,5 script Questboard 4_BOARD3,{ if(c_run==true){ mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ currentquest$ + "_collectionitem")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+"/"+getd("."+currentquest$+"_collectionitem["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +currentquest$+"_collectionprize"))?getitemname(getd("." +currentquest$+"_collectionprize"))+" - "+getd("." +currentquest$+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +currentquest$+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+1+"]")+"^000000"; next; if(select("Finish:Abort") == 2){ mes "[^FF7700Questboard^000000]"; mes "Quest aborted."; set currentquest$, ""; set c_run, false; close; } goto L_checkitems; } if(h_run==true){ mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ currentquest$ + "_huntingmob")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@j)+"]"); mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["+.@j+"]"))+" - "+getd(currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +currentquest$+"_huntingprize"))?getitemname(getd("." +currentquest$+"_huntingprize"))+" - "+getd("." +currentquest$+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +currentquest$+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+1+"]")+"^000000"; next; if(select("Finish:Abort") == 2){ mes "[^FF7700Questboard^000000]"; mes "Quest aborted."; for(set .@x, 1; .@x < .@size; set .@x,.@x+2){ set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]"); setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0); } set currentquest$, ""; set h_run, false; close; } goto L_checkmobs; } mes "[^FF7700Questboard^000000]"; mes "Select category:"; next; switch(select((.collection)?"Collection Quests":"", (.hunting)?"Hunting Quests":"", "Exit")) { case 1: set .@collectmenu$, ""; for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1){ if (.@i) set .@collectmenu$,.@collectmenu$+":"; set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i+1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + "_collectionname$"); } set .@selection,select(.@collectmenu$); if(.quest_repeat == true){ if(gettimetick(2) < getd(.@selection + "_collection_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd(.@selection + "_collection_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd(.@selection + "_collection_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ .@selection + "_collectionitem")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." +.@selection+"_collectionmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set c_run, true; set currentquest$, .@selection; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 2: set .@huntmenu$, ""; for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1){ if (.@i) set .@huntmenu$,.@huntmenu$+":"; set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$"); } set .@selection,select(.@huntmenu$); if(.quest_repeat == true){ if(gettimetick(2) < getd(.@selection + "_hunting_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd(.@selection + "_hunting_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd(.@selection + "_hunting_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ .@selection + "_huntingmob")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." +.@selection+"_huntingmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set h_run, true; set currentquest$, .@selection; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 3: close; } L_checkitems: set .@size, getarraysize(getd("."+currentquest$+"_collectionitem")); for( set .@k,0; .@k < .@size; set .@k,.@k+2){ if(countitem(getd("."+currentquest$+"_collectionitem["+.@k+"]"))>=getd("."+currentquest$+"_collectionitem["+(.@k+1)+"]")){ set .@checkitem,.@checkitem+2; } } if(.@checkitem<.@size){ mes "[^FF7700Questboard^000000]"; mes "You don't have everything."; close; } for( set .@delcount,0; .@delcount < .@size; set .@delcount,.@delcount+2){ delitem getd("."+currentquest$+"_collectionitem["+.@delcount+"]"),getd("."+currentquest$+"_collectionitem["+(.@delcount+1)+"]"); } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; if(getd("." +currentquest$+"_collectionprize")!=0) getitem(getd("." +currentquest$+"_collectionprize"),getd("." +currentquest$+"_collectionamount")); set Zeny,Zeny+getd("." +currentquest$+"_collectionzeny"); getexp getd("." +currentquest$+"_collectionexp["+0+"]"),getd("." +currentquest$+"_collectionexp["+1+"]"); setd(currentquest$ + "_collection_delay"),gettimetick(2)+.quest_delay; setd(currentquest$ + "_collection_repeat"),true; set currentquest$, ""; set c_run, false; close; L_checkmobs: set .@size, getarraysize(getd("."+currentquest$+"_huntingmob")); set .@goal, .@size/2; for(set .@i, 1; .@i < .@size; set .@i,.@i+2){ set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]"); if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")==getd("."+currentquest$+"_huntingmob["+.@i+"]")){ set .@checkmonster, .@checkmonster+1; if(.@checkmonster==.@goal){ goto L_checkmobs2; } continue; } goto L_checkmobs2; } L_checkmobs2: if(.@checkmonster<.@goal){ mes "[^FF7700Questboard^000000]"; mes "You didn't kill everything."; close; } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; set .@size, getarraysize(getd("."+currentquest$+"_huntingmob")); for(set .@x, 1; .@x < .@size; set .@x,.@x+2){ set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]"); setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0); } if(getd("." +currentquest$+"_huntingprize")!=0) getitem(getd("." +currentquest$+"_huntingprize"),getd("." +currentquest$+"_huntingamount")); set Zeny, Zeny+getd("." +currentquest$+"_huntingzeny"); getexp getd("." +currentquest$+"_huntingexp["+0+"]"),getd("." +currentquest$+"_huntingexp["+1+"]"); setd(currentquest$ + "_hunting_delay"),gettimetick(2)+.quest_delay; setd(currentquest$ + "_hunting_repeat"),true; set currentquest$, ""; set h_run, false; close; OnNPCKillEvent: if(h_run!=true) end; set .@size, getarraysize(getd("."+currentquest$+"_huntingmob")); for(set .@i, 1; .@i < .@size; set .@i,.@i+2){ if(killedrid==getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]")){ set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]"); if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")<getd("."+currentquest$+"_huntingmob["+.@i+"]")){ setd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+1); dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+ getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+.@i+"]")+")"; } if(getcharid(1) != 0 && .party_support == true){ getmapxy(.@map1$,.@x1,.@y1); set .@killerid, getcharid(3); set .@currentquest$, currentquest$; getpartymember getcharid(1),1; getpartymember getcharid(1),2; for(set .@j, 0; .@j < $@partymembercount; .@j++){ if(isloggedin($@partymemberaid[.@j], $@partymembercid[.@j])){ if(h_run==true && $@partymemberaid[.@j] != .@killerid && .@currentquest$ == getvar(currentquest$, $@partymembercid[.@j]) && readparam(HP, $@partymembercid[.@j]) > 0){ getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name($@partymemberaid[.@j])); if(.@map1$ == .@map2$ && distance(.@x1,.@y1,.@x2,.@y2) < .party_range){ set .@kill_amt,getvar(getd(.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount"), $@partymembercid[.@j]); set .@kill_goal,getd("."+.@currentquest$+"_huntingmob["+.@i+"]"); if(.@kill_amt<.@kill_goal) { setd(.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", .@kill_amt+1, $@partymembercid[.@j]); dispbottom getd("."+.@currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+(.@kill_amt+1)+"/"+.@kill_goal+")", 0xB6FF00, $@partymembercid[.@j]; } } } } } } break; } } end; OnInit: function AddCollection; function AddHunting; //Activate/Deactivate quest categories (true/1 - activated, false/0 - deactivated) set .collection, true; set .hunting, true; //Quest Delay (seconds) //24 hours = 86400 seconds set .quest_delay, 60; //Activate/Deactivate repeatable quests (true/1 - activated, false/0 - deactivated) set .quest_repeat, true; //Activate/Deactivate party support (true/1 - activated, false/0 - deactivated) set .party_support, true; //Max range for party support (+- x & y coordinations) set .party_range, 25; //Checks if quests are loaded (prevents out of index) if(.questsloaded==true) end; set .questsloaded, true; //Add Collection Quests here (You can add as many required items as you want) //AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...); AddCollection("Bloody Branch Wisdom",90,99,7720,2,2000,1000000,500000,604,150,7939,5,7203,5); //Add Hunting Quests here (You can add as many required mobs as you want) //AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...); end; function AddCollection{ set .collectionquestcount,.collectionquestcount+1; setd ("." +.collectionquestcount+"_collectionname$", getarg(0)); setd ("." +.collectionquestcount+"_collectionmin", getarg(1)); setd ("." +.collectionquestcount+"_collectionmax", getarg(2)); setd ("." +.collectionquestcount+"_collectionprize", getarg(3)); setd ("." +.collectionquestcount+"_collectionamount", getarg(4)); setd ("." +.collectionquestcount+"_collectionzeny", getarg(5)); set .@argcount, 6; set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionexp")); setd ("." +.collectionquestcount+"_collectionexp["+.@size+"]",getarg(.@argcount)); setd ("." +.collectionquestcount+"_collectionexp["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount, .@argcount+2; set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionitem")); while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){ setd ("."+.collectionquestcount+"_collectionitem["+.@size+"]",getarg(.@argcount)); setd ("."+.collectionquestcount+"_collectionitem["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount,.@argcount+2; set .@size, .@size+2; } return; } function AddHunting{ set .huntingquestcount,.huntingquestcount+1; setd ("." +.huntingquestcount+"_huntingname$", getarg(0)); setd ("." +.huntingquestcount+"_huntingmin", getarg(1)); setd ("." +.huntingquestcount+"_huntingmax", getarg(2)); setd ("." +.huntingquestcount+"_huntingprize", getarg(3)); setd ("." +.huntingquestcount+"_huntingamount", getarg(4)); setd ("." +.huntingquestcount+"_huntingzeny", getarg(5)); set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingexp")); set .@argcount, 6; setd ("." +.huntingquestcount+"_huntingexp["+.@size+"]",getarg(.@argcount)); setd ("." +.huntingquestcount+"_huntingexp["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount, .@argcount+2; set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingmob")); while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){ setd ("."+.huntingquestcount+"_huntingmob["+.@size+"]",getarg(.@argcount)); setd ("."+.huntingquestcount+"_huntingmob["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount, .@argcount+2; set .@size, .@size+2; } return; } } Quote Link to comment Share on other sites More sharing options...
0 Mabuhay Posted June 19, 2020 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 446 Reputation: 232 Joined: 03/20/12 Last Seen: October 22, 2020 Share Posted June 19, 2020 Change all char-bound variables to account-bound. Variables --------- The meat of every programming language is variables - places where you store data. In the rAthena scripting language, variable names are not case sensitive. Variables are divided into and uniquely identified by the combination of: prefix - determines the scope and extent (or lifetime) of the variable name - an identifier consisting of '_' and alphanumeric characters postfix - determines the type of the variable: integer or string Scope can be: global - global to all servers local - local to the server account - attached to the account of the character identified by RID character - attached to the character identified by RID npc - attached to the NPC scope - attached to the scope of the instance Extent can be: permanent - They still exist when the server resets. temporary - They cease to exist when the server resets. Prefix: scope and extent nothing - A permanent variable attached to the character, the default variable type. They are stored by char-server in the `char_reg_num` and `char_reg_str`. "@" - A temporary variable attached to the character. SVN versions before 2094 revision and RC5 version will also treat 'l' as a temporary variable prefix, so beware of having variable names starting with 'l' if you want full backward compatibility. "$" - A global permanent variable. They are stored by map-server in database table `mapreg`. "$@" - A global temporary variable. This is important for scripts which are called with no RID attached, that is, not triggered by a specific character object. "." - A NPC variable. They exist in the NPC and disappear when the server restarts or the NPC is reloaded. Can be accessed from inside the NPC or by calling 'getvariableofnpc'. Function objects can also have .variables which are accessible from inside the function, however 'getvariableofnpc' does NOT work on function objects. ".@" - A scope variable. They are unique to the instance and scope. Each instance has its own scope that ends when the script ends. Calling a function with callsub/callfunc starts a new scope, returning from the function ends it. When a scope ends, its variables are converted to values ('return .@var;' returns a value, not a reference). "'" - An instance variable. These are used with the instancing system and are unique to each instance type. Can be accessed from inside the instance or by calling 'getvariableofinstance'. "#" - A permanent local account variable. They are stored by char-server in the `acc_reg_num` table and `acc_reg_str`. "##" - A permanent global account variable stored by the login server. They are stored in the `global_acc_reg_num` table and `global_acc_reg_str`. The only difference you will note from normal # variables is when you have multiple char-servers connected to the same login server. The # variables are unique to each char-server, while the ## variables are shared by all these char-servers. Postfix: integer or string nothing - integer variable, can store positive and negative numbers, but only whole numbers (so don't expect to do any fractional math) '$' - string variable, can store text Examples: name - permanent character integer variable name$ - permanent character string variable @name - temporary character integer variable @name$ - temporary character string variable $name - permanent global integer variable $name$ - permanent global string variable $@name - temporary global integer variable $@name$ - temporary global string variable .name - NPC integer variable .name$ - NPC string variable .@name - scope integer variable .@name$ - scope string variable 'name - instance integer variable 'name$ - instance string variable #name - permanent local account integer variable #name$ - permanent local account string variable ##name - permanent global account integer variable ##name$ - permanent global account string variable Quote Link to comment Share on other sites More sharing options...
0 Eross Posted June 19, 2020 Group: Members Topic Count: 166 Topics Per Day: 0.09 Content Count: 377 Reputation: 12 Joined: 04/05/20 Last Seen: 3 hours ago Author Share Posted June 19, 2020 9 minutes ago, Mabuhay said: Change all char-bound variables to account-bound. Variables --------- The meat of every programming language is variables - places where you store data. In the rAthena scripting language, variable names are not case sensitive. Variables are divided into and uniquely identified by the combination of: prefix - determines the scope and extent (or lifetime) of the variable name - an identifier consisting of '_' and alphanumeric characters postfix - determines the type of the variable: integer or string Scope can be: global - global to all servers local - local to the server account - attached to the account of the character identified by RID character - attached to the character identified by RID npc - attached to the NPC scope - attached to the scope of the instance Extent can be: permanent - They still exist when the server resets. temporary - They cease to exist when the server resets. Prefix: scope and extent nothing - A permanent variable attached to the character, the default variable type. They are stored by char-server in the `char_reg_num` and `char_reg_str`. "@" - A temporary variable attached to the character. SVN versions before 2094 revision and RC5 version will also treat 'l' as a temporary variable prefix, so beware of having variable names starting with 'l' if you want full backward compatibility. "$" - A global permanent variable. They are stored by map-server in database table `mapreg`. "$@" - A global temporary variable. This is important for scripts which are called with no RID attached, that is, not triggered by a specific character object. "." - A NPC variable. They exist in the NPC and disappear when the server restarts or the NPC is reloaded. Can be accessed from inside the NPC or by calling 'getvariableofnpc'. Function objects can also have .variables which are accessible from inside the function, however 'getvariableofnpc' does NOT work on function objects. ".@" - A scope variable. They are unique to the instance and scope. Each instance has its own scope that ends when the script ends. Calling a function with callsub/callfunc starts a new scope, returning from the function ends it. When a scope ends, its variables are converted to values ('return .@var;' returns a value, not a reference). "'" - An instance variable. These are used with the instancing system and are unique to each instance type. Can be accessed from inside the instance or by calling 'getvariableofinstance'. "#" - A permanent local account variable. They are stored by char-server in the `acc_reg_num` table and `acc_reg_str`. "##" - A permanent global account variable stored by the login server. They are stored in the `global_acc_reg_num` table and `global_acc_reg_str`. The only difference you will note from normal # variables is when you have multiple char-servers connected to the same login server. The # variables are unique to each char-server, while the ## variables are shared by all these char-servers. Postfix: integer or string nothing - integer variable, can store positive and negative numbers, but only whole numbers (so don't expect to do any fractional math) '$' - string variable, can store text Examples: name - permanent character integer variable name$ - permanent character string variable @name - temporary character integer variable @name$ - temporary character string variable $name - permanent global integer variable $name$ - permanent global string variable $@name - temporary global integer variable $@name$ - temporary global string variable .name - NPC integer variable .name$ - NPC string variable .@name - scope integer variable .@name$ - scope string variable 'name - instance integer variable 'name$ - instance string variable #name - permanent local account integer variable #name$ - permanent local account string variable ##name - permanent global account integer variable ##name$ - permanent global account string variable Hi ! thankyou ! you mean I will change it to #variable ?? how will I distinguish what variable is char-bound ? thanks Quote Link to comment Share on other sites More sharing options...
0 Mabuhay Posted June 19, 2020 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 446 Reputation: 232 Joined: 03/20/12 Last Seen: October 22, 2020 Share Posted June 19, 2020 1 minute ago, erjsanmiguel said: Hi ! thankyou ! you mean I will change it to #variable ?? how will I distinguish what variable is char-bound ? thanks I already sent you the visual instruction how to determine.. Please read it. Quote Link to comment Share on other sites More sharing options...
0 Eross Posted June 19, 2020 Group: Members Topic Count: 166 Topics Per Day: 0.09 Content Count: 377 Reputation: 12 Joined: 04/05/20 Last Seen: 3 hours ago Author Share Posted June 19, 2020 On 6/19/2020 at 11:40 AM, Mabuhay said: I already sent you the visual instruction how to determine.. Please read it. I'm sorry im just noob On 6/19/2020 at 11:40 AM, Mabuhay said: I already sent you the visual instruction how to determine.. Please read it. //===== rAthena Script ======================================= //= tr0n's Questboard //===== By: ================================================== //= tr0n //===== Current Version: ===================================== //= 1.6.6 //===== Description: ========================================= //= Easily add collection and hunting quests. //===== Changelogs: ========================================== // 1.0.0 Release // 1.1.0 Added zeny reward // 1.2.0 Rewrote checkmob and killcounter // 1.3.1 Added level restriction // 1.3.4 Added Reward Item Amount // 1.4.4 Added Quest delay // 1.5.4 Added repeatable Quests // 1.6.4 Added party support // 1.6.5 Bug fixes for party support // 1.6.6 Bug fixes for delay time does not appear [mazvi] //============================================================ malaya,233,200,5 script Questboard 4_BOARD3,{ if(#c_run==true){ mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + #currentquest$ + "_collectionname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ #currentquest$ + "_collectionitem")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ mes "^FF0000"+getitemname(getd("."+#currentquest$+"_collectionitem["+.@j+"]"))+" - "+countitem(getd("."+#currentquest$+"_collectionitem["+.@j+"]"))+"/"+getd("."+#currentquest$+"_collectionitem["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +#currentquest$+"_collectionprize"))?getitemname(getd("." +#currentquest$+"_collectionprize"))+" - "+getd("." +#currentquest$+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +#currentquest$+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +#currentquest$+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +#currentquest$+"_collectionexp["+1+"]")+"^000000"; next; if(select("Finish:Abort") == 2){ mes "[^FF7700Questboard^000000]"; mes "Quest aborted."; set #currentquest$, ""; set #c_run, false; close; } goto L_checkitems; } if(#h_run==true){ mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + #currentquest$ + "_huntingname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ #currentquest$ + "_huntingmob")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ set .@currentmob, getd("."+#currentquest$+"_huntingmob["+(.@j)+"]"); mes "^FF0000"+strmobinfo(1,getd("."+#currentquest$+"_huntingmob["+.@j+"]"))+" - "+getd(#currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+#currentquest$+"_huntingmob["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +#currentquest$+"_huntingprize"))?getitemname(getd("." +#currentquest$+"_huntingprize"))+" - "+getd("." +#currentquest$+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +#currentquest$+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +#currentquest$+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +#currentquest$+"_huntingexp["+1+"]")+"^000000"; next; if(select("Finish:Abort") == 2){ mes "[^FF7700Questboard^000000]"; mes "Quest aborted."; for(set .@x, 1; .@x < .@size; set .@x,.@x+2){ set .@currentmob, getd("."+#currentquest$+"_huntingmob["+(.@x-1)+"]"); setd(#currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0); } set #currentquest$, ""; set #h_run, false; close; } goto L_checkmobs; } mes "[^FF7700Questboard^000000]"; mes "Select category:"; next; switch(select((.collection)?"Collection Quests":"", (.hunting)?"Hunting Quests":"", "Exit")) { case 1: set .@collectmenu$, ""; for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1){ if (.@i) set .@collectmenu$,.@collectmenu$+":"; set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i+1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + "_collectionname$"); } set .@selection,select(.@collectmenu$); if(.quest_repeat == true){ if(gettimetick(2) < getd(.@selection + "#collection_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd(.@selection + "#collection_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd(.@selection + "#collection_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ .@selection + "_collectionitem")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." +.@selection+"_collectionmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set #c_run, true; set #currentquest$, .@selection; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 2: set .@huntmenu$, ""; for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1){ if (.@i) set .@huntmenu$,.@huntmenu$+":"; set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$"); } set .@selection,select(.@huntmenu$); if(.quest_repeat == true){ if(gettimetick(2) < getd(.@selection + "_hunting_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd(.@selection + "_hunting_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd(.@selection + "_hunting_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000"; mes "--------------------------------"; set .@size, getarraysize(getd("."+ .@selection + "_huntingmob")); for( set .@j, 0; .@j < .@size; set .@j,.@j+2){ mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." +.@selection+"_huntingmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set #h_run, true; set #currentquest$, .@selection; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 3: close; } L_checkitems: set .@size, getarraysize(getd("."+#currentquest$+"_collectionitem")); for( set .@k,0; .@k < .@size; set .@k,.@k+2){ if(countitem(getd("."+#currentquest$+"_collectionitem["+.@k+"]"))>=getd("."+#currentquest$+"_collectionitem["+(.@k+1)+"]")){ set .@checkitem,.@checkitem+2; } } if(.@checkitem<.@size){ mes "[^FF7700Questboard^000000]"; mes "You don't have everything."; close; } for( set .@delcount,0; .@delcount < .@size; set .@delcount,.@delcount+2){ delitem getd("."+#currentquest$+"_collectionitem["+.@delcount+"]"),getd("."+#currentquest$+"_collectionitem["+(.@delcount+1)+"]"); } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; if(getd("." +#currentquest$+"_collectionprize")!=0) getitem(getd("." +#currentquest$+"_collectionprize"),getd("." +#currentquest$+"_collectionamount")); set Zeny,Zeny+getd("." +#currentquest$+"_collectionzeny"); getexp getd("." +#currentquest$+"_collectionexp["+0+"]"),getd("." +#currentquest$+"_collectionexp["+1+"]"); setd(#currentquest$ + "#collection_delay"),gettimetick(2)+.quest_delay; setd(#currentquest$ + "#collection_repeat"),true; set #currentquest$, ""; set #c_run, false; close; L_checkmobs: set .@size, getarraysize(getd("."+#currentquest$+"_huntingmob")); set .@goal, .@size/2; for(set .@i, 1; .@i < .@size; set .@i,.@i+2){ set .@currentmob, getd("."+#currentquest$+"_huntingmob["+(.@i-1)+"]"); if(getd(#currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")==getd("."+#currentquest$+"_huntingmob["+.@i+"]")){ set .@checkmonster, .@checkmonster+1; if(.@checkmonster==.@goal){ goto L_checkmobs2; } continue; } goto L_checkmobs2; } L_checkmobs2: if(.@checkmonster<.@goal){ mes "[^FF7700Questboard^000000]"; mes "You didn't kill everything."; close; } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; set .@size, getarraysize(getd("."+#currentquest$+"_huntingmob")); for(set .@x, 1; .@x < .@size; set .@x,.@x+2){ set .@currentmob, getd("."+#currentquest$+"_huntingmob["+(.@x-1)+"]"); setd(#currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0); } if(getd("." +#currentquest$+"_huntingprize")!=0) getitem(getd("." +#currentquest$+"_huntingprize"),getd("." +#currentquest$+"_huntingamount")); set Zeny, Zeny+getd("." +#currentquest$+"_huntingzeny"); getexp getd("." +#currentquest$+"_huntingexp["+0+"]"),getd("." +#currentquest$+"_huntingexp["+1+"]"); setd(#currentquest$ + "_hunting_delay"),gettimetick(2)+.quest_delay; setd(#currentquest$ + "_hunting_repeat"),true; set #currentquest$, ""; set #h_run, false; close; OnNPCKillEvent: if(#h_run!=true) end; set .@size, getarraysize(getd("."+#currentquest$+"_huntingmob")); for(set .@i, 1; .@i < .@size; set .@i,.@i+2){ if(killedrid==getd("."+#currentquest$+"_huntingmob["+(.@i-1)+"]")){ set .@currentmob, getd("."+#currentquest$+"_huntingmob["+(.@i-1)+"]"); if(getd(#currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")<getd("."+#currentquest$+"_huntingmob["+.@i+"]")){ setd(#currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", getd(#currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+1); dispbottom getd("."+#currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+ getd(#currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd("."+#currentquest$+"_huntingmob["+.@i+"]")+")"; } if(getcharid(1) != 0 && .party_support == true){ getmapxy(.@map1$,.@x1,.@y1); set .@killerid, getcharid(3); set .@currentquest$, #currentquest$; getpartymember getcharid(1),1; getpartymember getcharid(1),2; for(set .@j, 0; .@j < $@partymembercount; .@j++){ if(isloggedin($@partymemberaid[.@j], $@partymembercid[.@j])){ if(#h_run==true && $@partymemberaid[.@j] != .@killerid && .@currentquest$ == getvar(#currentquest$, $@partymembercid[.@j]) && readparam(HP, $@partymembercid[.@j]) > 0){ getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name($@partymemberaid[.@j])); if(.@map1$ == .@map2$ && distance(.@x1,.@y1,.@x2,.@y2) < .party_range){ set .@kill_amt,getvar(getd(.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount"), $@partymembercid[.@j]); set .@kill_goal,getd("."+.@currentquest$+"_huntingmob["+.@i+"]"); if(.@kill_amt<.@kill_goal) { setd(.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", .@kill_amt+1, $@partymembercid[.@j]); dispbottom getd("."+.@currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+(.@kill_amt+1)+"/"+.@kill_goal+")", 0xB6FF00, $@partymembercid[.@j]; } } } } } } break; } } end; OnInit: function AddCollection; function AddHunting; //Activate/Deactivate quest categories (true/1 - activated, false/0 - deactivated) set .collection, true; set .hunting, true; //Quest Delay (seconds) //24 hours = 86400 seconds set .quest_delay, 30; //Activate/Deactivate repeatable quests (true/1 - activated, false/0 - deactivated) set .quest_repeat, true; //Activate/Deactivate party support (true/1 - activated, false/0 - deactivated) set .party_support, true; //Max range for party support (+- x & y coordinations) set .party_range, 25; //Checks if quests are loaded (prevents out of index) if(.questsloaded==true) end; set .questsloaded, true; //Add Collection Quests here (You can add as many required items as you want) //AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...); AddCollection("Bloody Branch Wisdom",90,99,7720,2,2000,1000000,500000,604,1); //Add Hunting Quests here (You can add as many required mobs as you want) //AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...); end; function AddCollection{ set .collectionquestcount,.collectionquestcount+1; setd ("." +.collectionquestcount+"_collectionname$", getarg(0)); setd ("." +.collectionquestcount+"_collectionmin", getarg(1)); setd ("." +.collectionquestcount+"_collectionmax", getarg(2)); setd ("." +.collectionquestcount+"_collectionprize", getarg(3)); setd ("." +.collectionquestcount+"_collectionamount", getarg(4)); setd ("." +.collectionquestcount+"_collectionzeny", getarg(5)); set .@argcount, 6; set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionexp")); setd ("." +.collectionquestcount+"_collectionexp["+.@size+"]",getarg(.@argcount)); setd ("." +.collectionquestcount+"_collectionexp["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount, .@argcount+2; set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionitem")); while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){ setd ("."+.collectionquestcount+"_collectionitem["+.@size+"]",getarg(.@argcount)); setd ("."+.collectionquestcount+"_collectionitem["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount,.@argcount+2; set .@size, .@size+2; } return; } function AddHunting{ set .huntingquestcount,.huntingquestcount+1; setd ("." +.huntingquestcount+"_huntingname$", getarg(0)); setd ("." +.huntingquestcount+"_huntingmin", getarg(1)); setd ("." +.huntingquestcount+"_huntingmax", getarg(2)); setd ("." +.huntingquestcount+"_huntingprize", getarg(3)); setd ("." +.huntingquestcount+"_huntingamount", getarg(4)); setd ("." +.huntingquestcount+"_huntingzeny", getarg(5)); set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingexp")); set .@argcount, 6; setd ("." +.huntingquestcount+"_huntingexp["+.@size+"]",getarg(.@argcount)); setd ("." +.huntingquestcount+"_huntingexp["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount, .@argcount+2; set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingmob")); while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){ setd ("."+.huntingquestcount+"_huntingmob["+.@size+"]",getarg(.@argcount)); setd ("."+.huntingquestcount+"_huntingmob["+(.@size+1)+"]",getarg(.@argcount+1)); set .@argcount, .@argcount+2; set .@size, .@size+2; } return; } } Hi sir I tried this but still can quest on my other char >_< Quote Link to comment Share on other sites More sharing options...
0 Ryoma27 Posted February 24, 2022 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 29 Reputation: 1 Joined: 10/20/20 Last Seen: February 26 Share Posted February 24, 2022 use ##curentquest instead i think Quote Link to comment Share on other sites More sharing options...
Question
Eross
Hi ! how to make this quest board restrict only one character per account ??????? it seems like all character in one account can take quests -_-
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.