Eross Posted June 19, 2020 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 [email protected], getarraysize(getd("."+ currentquest$ + "_collectionitem")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))+"/"+getd("."+currentquest$+"_collectionitem["+([email protected]+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 [email protected], getarraysize(getd("."+ currentquest$ + "_huntingmob")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["[email protected]+"]"))+" - "+getd(currentquest$+"_"[email protected]+"_"+([email protected]+1)+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+([email protected]+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 [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); setd(currentquest$+"_"[email protected]+"_"[email protected]+"_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 [email protected]$, ""; for( set [email protected],0; [email protected] < .collectionquestcount; set [email protected],[email protected]+1){ if ([email protected]) set [email protected]$,[email protected]$+":"; set [email protected]$, [email protected]$ + "[" + getd("." +([email protected]+1)+"_collectionmin") + " - " + getd("." +([email protected]+1)+"_collectionmax") + "] " + getd("." + ([email protected]+1) + "_collectionname$"); } set [email protected],select([email protected]$); if(.quest_repeat == true){ if(gettimetick(2) < getd([email protected] + "_collection_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd([email protected] + "_collection_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd([email protected] + "_collection_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + [email protected] + "_collectionname$")+"^000000"; mes "--------------------------------"; set [email protected], getarraysize(getd("."+ [email protected] + "_collectionitem")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+getitemname(getd("."[email protected]+"_collectionitem["[email protected]+"]"))+" - "+getd("."[email protected]+"_collectionitem["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." [email protected]+"_collectionprize"))?getitemname(getd("." [email protected]+"_collectionprize"))+" - "+getd("." [email protected]+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." [email protected]+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." [email protected]+"_collectionmin") && BaseLevel <= getd("." [email protected]+"_collectionmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set c_run, true; set currentquest$, [email protected]; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 2: set [email protected]$, ""; for( set [email protected],0; [email protected] < .huntingquestcount; set [email protected],[email protected]+1){ if ([email protected]) set [email protected]$,[email protected]$+":"; set [email protected]$, [email protected]$ + "[" + getd("." +([email protected]+1)+"_huntingmin") + " - " + getd("." +([email protected]+1)+"_huntingmax") + "] " + getd("." + ([email protected]+1) + "_huntingname$"); } set [email protected],select([email protected]$); if(.quest_repeat == true){ if(gettimetick(2) < getd([email protected] + "_hunting_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd([email protected] + "_hunting_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd([email protected] + "_hunting_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + [email protected] + "_huntingname$")+"^000000"; mes "--------------------------------"; set [email protected], getarraysize(getd("."+ [email protected] + "_huntingmob")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+strmobinfo(1,getd("."[email protected]+"_huntingmob["[email protected]+"]"))+" - "+getd("."[email protected]+"_huntingmob["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." [email protected]+"_huntingprize"))?getitemname(getd("." [email protected]+"_huntingprize"))+" - "+getd("." [email protected]+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." [email protected]+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." [email protected]+"_huntingmin") && BaseLevel <= getd("." [email protected]+"_huntingmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set h_run, true; set currentquest$, [email protected]; 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 [email protected], getarraysize(getd("."+currentquest$+"_collectionitem")); for( set [email protected],0; [email protected] < [email protected]; set [email protected],[email protected]+2){ if(countitem(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))>=getd("."+currentquest$+"_collectionitem["+([email protected]+1)+"]")){ set [email protected],[email protected]+2; } } if([email protected]<[email protected]){ mes "[^FF7700Questboard^000000]"; mes "You don't have everything."; close; } for( set [email protected],0; [email protected] < [email protected]; set [email protected],[email protected]+2){ delitem getd("."+currentquest$+"_collectionitem["[email protected]+"]"),getd("."+currentquest$+"_collectionitem["+([email protected]+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 [email protected], getarraysize(getd("."+currentquest$+"_huntingmob")); set [email protected], [email protected]/2; for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); if(getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")==getd("."+currentquest$+"_huntingmob["[email protected]+"]")){ set [email protected], [email protected]+1; if([email protected][email protected]){ goto L_checkmobs2; } continue; } goto L_checkmobs2; } L_checkmobs2: if([email protected]<[email protected]){ mes "[^FF7700Questboard^000000]"; mes "You didn't kill everything."; close; } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; set [email protected], getarraysize(getd("."+currentquest$+"_huntingmob")); for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); setd(currentquest$+"_"[email protected]+"_"[email protected]+"_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 [email protected], getarraysize(getd("."+currentquest$+"_huntingmob")); for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ if(killedrid==getd("."+currentquest$+"_huntingmob["+([email protected])+"]")){ set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]"); if(getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")<getd("."+currentquest$+"_huntingmob["[email protected]+"]")){ setd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+1); dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo(1,[email protected])+"] ("+ getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["[email protected]+"]")+")"; } if(getcharid(1) != 0 && .party_support == true){ getmapxy([email protected]$,[email protected],[email protected]); set [email protected], getcharid(3); set [email protected]$, currentquest$; getpartymember getcharid(1),1; getpartymember getcharid(1),2; for(set [email protected], 0; [email protected] < [email protected]; [email protected]++){ if(isloggedin([email protected][[email protected]], [email protected][[email protected]])){ if(h_run==true && [email protected][[email protected]] != [email protected] && [email protected]$ == getvar(currentquest$, [email protected][[email protected]]) && readparam(HP, [email protected][[email protected]]) > 0){ getmapxy([email protected]$,[email protected],[email protected],BL_PC,rid2name([email protected][[email protected]])); if([email protected]$ == [email protected]$ && distance([email protected],[email protected],[email protected],[email protected]) < .party_range){ set [email protected]_amt,getvar(getd([email protected]$+"_"[email protected]+"_"[email protected]+"_killcount"), [email protected][[email protected]]); set [email protected]_goal,getd("."[email protected]$+"_huntingmob["[email protected]+"]"); if([email protected]_amt<[email protected]_goal) { setd([email protected]$+"_"[email protected]+"_"[email protected]+"_killcount", [email protected]_amt+1, [email protected][[email protected]]); dispbottom getd("."[email protected]$+"_huntingname$")+": ["+strmobinfo(1,[email protected])+"] ("+([email protected]_amt+1)+"/"[email protected]_goal+")", 0xB6FF00, [email protected][[email protected]]; } } } } } } 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 [email protected], 6; set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionexp")); setd ("." +.collectionquestcount+"_collectionexp["[email protected]+"]",getarg([email protected])); setd ("." +.collectionquestcount+"_collectionexp["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected], [email protected]+2; set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionitem")); while(getarg([email protected],-1)!=-1 && getarg([email protected]+1,-1)!=-1){ setd ("."+.collectionquestcount+"_collectionitem["[email protected]+"]",getarg([email protected])); setd ("."+.collectionquestcount+"_collectionitem["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected],[email protected]+2; set [email protected], [email protected]+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 [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingexp")); set [email protected], 6; setd ("." +.huntingquestcount+"_huntingexp["[email protected]+"]",getarg([email protected])); setd ("." +.huntingquestcount+"_huntingexp["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected], [email protected]+2; set [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingmob")); while(getarg([email protected]t,-1)!=-1 && getarg([email protected]+1,-1)!=-1){ setd ("."+.huntingquestcount+"_huntingmob["[email protected]+"]",getarg([email protected])); setd ("."+.huntingquestcount+"_huntingmob["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected], [email protected]+2; set [email protected], [email protected]+2; } return; } } Â Quote Link to comment Share on other sites More sharing options...
0 Mabuhay Posted June 19, 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`. "[email protected]" - 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. "[email protected]" - 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 [email protected];' 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 [email protected] - temporary global integer variable [email protected]$ - temporary global string variable .name - NPC integer variable .name$ - NPC string variable [email protected] - scope integer variable [email protected]$ - 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 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`. "[email protected]" - 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. "[email protected]" - 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 [email protected];' 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 [email protected] - temporary global integer variable [email protected]$ - temporary global string variable .name - NPC integer variable .name$ - NPC string variable [email protected] - scope integer variable [email protected]$ - 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 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 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 [email protected], getarraysize(getd("."+ #currentquest$ + "_collectionitem")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+getitemname(getd("."+#currentquest$+"_collectionitem["[email protected]+"]"))+" - "+countitem(getd("."+#currentquest$+"_collectionitem["[email protected]+"]"))+"/"+getd("."+#currentquest$+"_collectionitem["+([email protected]+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 [email protected], getarraysize(getd("."+ #currentquest$ + "_huntingmob")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+#currentquest$+"_huntingmob["+([email protected])+"]"); mes "^FF0000"+strmobinfo(1,getd("."+#currentquest$+"_huntingmob["[email protected]+"]"))+" - "+getd(#currentquest$+"_"[email protected]+"_"+([email protected]+1)+"_killcount")+"/"+getd("."+#currentquest$+"_huntingmob["+([email protected]+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 [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+#currentquest$+"_huntingmob["+([email protected])+"]"); setd(#currentquest$+"_"[email protected]+"_"[email protected]+"_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 [email protected]$, ""; for( set [email protected],0; [email protected] < .collectionquestcount; set [email protected],[email protected]+1){ if ([email protected]) set [email protected]$,[email protected]$+":"; set [email protected]$, [email protected]$ + "[" + getd("." +([email protected]+1)+"_collectionmin") + " - " + getd("." +([email protected]+1)+"_collectionmax") + "] " + getd("." + ([email protected]+1) + "_collectionname$"); } set [email protected],select([email protected]$); if(.quest_repeat == true){ if(gettimetick(2) < getd([email protected] + "#collection_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd([email protected] + "#collection_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd([email protected] + "#collection_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + [email protected] + "_collectionname$")+"^000000"; mes "--------------------------------"; set [email protected], getarraysize(getd("."+ [email protected] + "_collectionitem")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+getitemname(getd("."[email protected]+"_collectionitem["[email protected]+"]"))+" - "+getd("."[email protected]+"_collectionitem["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." [email protected]+"_collectionprize"))?getitemname(getd("." [email protected]+"_collectionprize"))+" - "+getd("." [email protected]+"_collectionamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." [email protected]+"_collectionzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." [email protected]+"_collectionmin") && BaseLevel <= getd("." [email protected]+"_collectionmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set #c_run, true; set #currentquest$, [email protected]; close; } else{ mes "[^FF7700Questboard^000000]"; mes "You don't have the required"; mes "level to do this quest."; close; } case 2: set [email protected]$, ""; for( set [email protected],0; [email protected] < .huntingquestcount; set [email protected],[email protected]+1){ if ([email protected]) set [email protected]$,[email protected]$+":"; set [email protected]$, [email protected]$ + "[" + getd("." +([email protected]+1)+"_huntingmin") + " - " + getd("." +([email protected]+1)+"_huntingmax") + "] " + getd("." + ([email protected]+1) + "_huntingname$"); } set [email protected],select([email protected]$); if(.quest_repeat == true){ if(gettimetick(2) < getd([email protected] + "_hunting_delay")){ mes "[^FF7700Questboard^000000]"; mes "You have to wait ^0000FF"+Time2Str(getd([email protected] + "_hunting_delay"))+"^000000 to do this quest again."; close; } } else{ if(getd([email protected] + "_hunting_repeat") == true){ mes "[^FF7700Questboard^000000]"; mes "You already did this quest."; mes "Please choose another one."; close; } } mes "[^FF7700Questboard^000000]"; mes "^0000FF"+getd("." + [email protected] + "_huntingname$")+"^000000"; mes "--------------------------------"; set [email protected], getarraysize(getd("."+ [email protected] + "_huntingmob")); for( set [email protected], 0; [email protected] < [email protected]; set [email protected],[email protected]+2){ mes "^FF0000"+strmobinfo(1,getd("."[email protected]+"_huntingmob["[email protected]+"]"))+" - "+getd("."[email protected]+"_huntingmob["+([email protected]+1)+"]")+" ea.^000000"; } mes "--------------------------------"; mes "[Reward]"; mes "Item: ^0000FF"+((getd("." [email protected]+"_huntingprize"))?getitemname(getd("." [email protected]+"_huntingprize"))+" - "+getd("." [email protected]+"_huntingamount")+" ea.^000000":"Nothing^000000"); mes "Zeny: ^0000FF"+getd("." [email protected]+"_huntingzeny")+"^000000"; mes "Base EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+0+"]")+"^000000"; mes "Job EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+1+"]")+"^000000"; next; if(select("Accept:Decline") == 2){ close; } if(BaseLevel >= getd("." [email protected]+"_huntingmin") && BaseLevel <= getd("." [email protected]+"_huntingmax")){ mes "[^FF7700Questboard^000000]"; mes "Quest accepted."; set #h_run, true; set #currentquest$, [email protected]; 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 [email protected], getarraysize(getd("."+#currentquest$+"_collectionitem")); for( set [email protected],0; [email protected] < [email protected]; set [email protected],[email protected]+2){ if(countitem(getd("."+#currentquest$+"_collectionitem["[email protected]+"]"))>=getd("."+#currentquest$+"_collectionitem["+([email protected]+1)+"]")){ set [email protected],[email protected]+2; } } if([email protected]<[email protected]){ mes "[^FF7700Questboard^000000]"; mes "You don't have everything."; close; } for( set [email protected],0; [email protected] < [email protected]; set [email protected],[email protected]+2){ delitem getd("."+#currentquest$+"_collectionitem["[email protected]+"]"),getd("."+#currentquest$+"_collectionitem["+([email protected]+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 [email protected], getarraysize(getd("."+#currentquest$+"_huntingmob")); set [email protected], [email protected]/2; for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+#currentquest$+"_huntingmob["+([email protected])+"]"); if(getd(#currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")==getd("."+#currentquest$+"_huntingmob["[email protected]+"]")){ set [email protected], [email protected]+1; if([email protected][email protected]){ goto L_checkmobs2; } continue; } goto L_checkmobs2; } L_checkmobs2: if([email protected]<[email protected]){ mes "[^FF7700Questboard^000000]"; mes "You didn't kill everything."; close; } mes "[^FF7700Questboard^000000]"; mes "Congratulation! Here is your Reward."; set [email protected], getarraysize(getd("."+#currentquest$+"_huntingmob")); for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ set [email protected], getd("."+#currentquest$+"_huntingmob["+([email protected])+"]"); setd(#currentquest$+"_"[email protected]+"_"[email protected]+"_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 [email protected], getarraysize(getd("."+#currentquest$+"_huntingmob")); for(set [email protected], 1; [email protected] < [email protected]; set [email protected],[email protected]+2){ if(killedrid==getd("."+#currentquest$+"_huntingmob["+([email protected])+"]")){ set [email protected], getd("."+#currentquest$+"_huntingmob["+([email protected])+"]"); if(getd(#currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")<getd("."+#currentquest$+"_huntingmob["[email protected]+"]")){ setd(#currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", getd(#currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+1); dispbottom getd("."+#currentquest$+"_huntingname$")+": ["+strmobinfo(1,[email protected])+"] ("+ getd(#currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+"/"+getd("."+#currentquest$+"_huntingmob["[email protected]+"]")+")"; } if(getcharid(1) != 0 && .party_support == true){ getmapxy([email protected]$,[email protected],[email protected]); set [email protected], getcharid(3); set [email protected]$, #currentquest$; getpartymember getcharid(1),1; getpartymember getcharid(1),2; for(set [email protected], 0; [email protected] < [email protected]; [email protected]++){ if(isloggedin([email protected][[email protected]], [email protected][[email protected]])){ if(#h_run==true && [email protected][[email protected]] != [email protected] && [email protected]$ == getvar(#currentquest$, [email protected][[email protected]]) && readparam(HP, [email protected][[email protected]]) > 0){ getmapxy([email protected]$,[email protected],[email protected],BL_PC,rid2name([email protected][[email protected]])); if([email protected]$ == [email protected]$ && distance([email protected],[email protected],[email protected],[email protected]) < .party_range){ set [email protected]_amt,getvar(getd([email protected]$+"_"[email protected]+"_"[email protected]+"_killcount"), [email protected][[email protected]]); set [email protected]_goal,getd("."[email protected]$+"_huntingmob["[email protected]+"]"); if([email protected]_amt<[email protected]_goal) { setd([email protected]$+"_"[email protected]+"_"[email protected]+"_killcount", [email protected]_amt+1, [email protected][[email protected]]); dispbottom getd("."[email protected]$+"_huntingname$")+": ["+strmobinfo(1,[email protected])+"] ("+([email protected]_amt+1)+"/"[email protected]_goal+")", 0xB6FF00, [email protected][[email protected]]; } } } } } } 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 [email protected], 6; set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionexp")); setd ("." +.collectionquestcount+"_collectionexp["[email protected]+"]",getarg([email protected])); setd ("." +.collectionquestcount+"_collectionexp["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected], [email protected]+2; set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionitem")); while(getarg([email protected],-1)!=-1 && getarg([email protected]+1,-1)!=-1){ setd ("."+.collectionquestcount+"_collectionitem["[email protected]+"]",getarg([email protected])); setd ("."+.collectionquestcount+"_collectionitem["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected],[email protected]+2; set [email protected], [email protected]+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 [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingexp")); set [email protected], 6; setd ("." +.huntingquestcount+"_huntingexp["[email protected]+"]",getarg([email protected])); setd ("." +.huntingquestcount+"_huntingexp["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected], [email protected]+2; set [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingmob")); while(getarg([email protected],-1)!=-1 && getarg([email protected]+1,-1)!=-1){ setd ("."+.huntingquestcount+"_huntingmob["[email protected]+"]",getarg([email protected])); setd ("."+.huntingquestcount+"_huntingmob["+([email protected]+1)+"]",getarg([email protected]+1)); set [email protected], [email protected]+2; set [email protected], [email protected]+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 Share Posted February 24 use ##curentquest instead i think Quote Link to comment Share on other sites More sharing options...
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