diff options
Diffstat (limited to 'npc/kafras/functions_kafras.txt')
-rw-r--r-- | npc/kafras/functions_kafras.txt | 325 |
1 files changed, 214 insertions, 111 deletions
diff --git a/npc/kafras/functions_kafras.txt b/npc/kafras/functions_kafras.txt index cf36e5e53..aa2290072 100644 --- a/npc/kafras/functions_kafras.txt +++ b/npc/kafras/functions_kafras.txt @@ -4,7 +4,7 @@ //= eAthena Dev Team //= Darlskies, Darkchild, Syrus22, Lupus, kobra_k88 (2.0) //===== Current Version: ===================================== -//= 5.4b +//= 5.5b //===== Compatible With: ===================================== //= eAthena 1.0 //===== Description: ========================================= @@ -46,6 +46,8 @@ //= 5.5 Added proper Niflheim welcome message. [L0ne_W0lf] //= Cleaned up the menus a bit. Got rid of the proceeding "-" prefix. //= 5.5b Missed a preceeding hyphen, which was screwing up teleporting. [L0ne_W0lf] +//= 5.6 Further dialog updates, added dynamic costs for cart and storage use. [L0ne_W0lf] +//= Updated some functions to handle Guild Kafras the way they should. //============================================================ @@ -53,12 +55,16 @@ //= arg(0): Used to determine which welcome message to show. //= arg(1): Used to determine which menu to display. //= arg(2): Used to determine if the info menu is shown in F_KafInfo. +//= arg(3): Cost to use Storage +//= arg(4): Cost to Rent a Pushcart //========================================================================== function script F_Kafra { callfunc "F_ClearGarbage"; //Clear outdated, unused variables - mes "[Kafra]"; + //Display Kafra Welcome Message + mes "[Kafra Employee]"; switch(getarg(0)){ + //Default message (obsolete) default: case 0: mes "Welcome to the"; @@ -67,66 +73,86 @@ function script F_Kafra { mes "are always on your side."; mes "How may I assist you?"; break; - //Niflheim + + //Niflheim specific message case 1: mes "^666666W-weeeelc-c-come"; mes "to th-the K-kaaafrrrra"; mes "C-coorpoor-r-ratioooonn...^000000"; break; - //Guilds Castles + + //Guild Castle Kafra message case 2: mes "Welcome. ^ff0000" + GetGuildName(@GID) + "^000000 Member."; mes "The Kafra Coporation will stay with you wherever you go."; break; - //Amatsu + + //Amatsu specific message (obsolete) case 3: mes "So, have you come from a faraway land to study our culture, or are you just sightseeing?"; mes "In either case, why not stay awhile?"; mes "The air is eternally heavy with the"; mes "scent of pleasant wildflowers."; break; - //Louyang, Ayothaya + + //Louyang and Ayothaya specific message (obsolete) case 4: mes "With our many Kafra"; mes "service locations, you're never"; mes "far from home."; break; + + //NPC has it's own welcome message. (Display nothing) + case 5: + break; } next; M_Menu: cleararray @K_Menu0$[0],"",7; switch(getarg(1)){ - //only Save & Storage + // Save and Storage only case 1: setarray @K_Menu0$[0],"Save","Use Storage","Cancel"; break; - //only Storage + + // Storage only case 2: setarray @K_Menu0$[0],"Use Storage","Cancel"; break; - //Common w/o teleport + + // No Teleport (Common) case 3: setarray @K_Menu0$[0],"Save","Use Storage","Rent a Pushcart","Guide","Check Other Information","Cancel"; break; - //Case 4 is Einbroch no tele message. - //Common w/o save and teleport + + // Case 4 is Einbroch no tele message. + + // No save, or teleport. (Common) case 5: setarray @K_Menu0$[0],"Use Storage","Rent a Pushcart","Check Other Information","Guide","Cancel"; break; - //Only storage and other info check + + // Storage and Check Other Information only. case 6: setarray @K_Menu0$[0],"Use Storage","Guide","Check Other Information","Cancel"; break; - //Common Kafra + + // Save, Storage, and Pushcart only (Kafra Warehouse) + case 7: + setarray @K_Menu0$[0],"Save","Use Storage","Rent a Pushcart","Cancel"; + break; + + // Common Kafra Employee default: setarray @K_Menu0$[0],"Save","Use Storage","Use Teleport Service","Rent a Pushcart","Guide","Check Other Information","Cancel"; break; } + + // Guild Kafra Menu override (free Teleport, free Storage, Free Cart) if(getarg(0)==2) { - //Guilds Kafra (free Teleport, free Storage, Free Cart) cleararray @K_Menu0$[0],"",7; - setarray @K_Menu0$[0],"Use Storage","Use Guild Storage","Rent a Cart","Use Teleport Service","Cancel"; + setarray @K_Menu0$[0],"Use Storage","Use Guild Storage","Rent a Pushcart","Use Teleport Service","Cancel"; } menu @K_Menu0$[0],K_Menu0,@K_Menu0$[1],K_Menu1,@K_Menu0$[2],K_Menu2, @K_Menu0$[3],K_Menu3,@K_Menu0$[4],K_Menu4,@K_Menu0$[5],K_Menu5, @@ -157,18 +183,23 @@ function script F_Kafra { K_Menuf: if (@K_Menu0$[@num] == "Save") return; if (@K_Menu0$[@num] == "Use Storage"){ - //Don't charge for a common Kafra Storage in your Castle - if(getarg(0) == 2) callfunc "F_KafStor",2; - else callfunc "F_KafStor",0; + // Do not charge for Guild Storage + if(getarg(0) == 2) callfunc "F_KafStor",2,0,0; + else callfunc "F_KafStor",0,getarg(3),getarg(0); next; goto M_Menu; } if (@K_Menu0$[@num] == "Use Teleport Service"){ - if(getarg(1) == 4){ //Check for Einbroch Tele notice - mes "[Kafra]"; - mes "Because of the ^FF0000Limited Transport Agreement^000000, the Kafra Corporation cannot provide Teleport Services in the Schwarzwald Republic."; + // Display Einbroch "No Teleport Service" notice. + if(getarg(1) == 4){ + mes "[Kafra Employee]"; + mes "Because of the ^FF0000Limited"; + mes "Transport Agreement^000000, the"; + mes "Kafra Corporation cannot"; + mes "provide Teleport Services"; + mes "in the Schwaltzvalt Republic."; next; - mes "[Kafra]"; + mes "[Kafra Employee]"; mes "We ask that you please"; mes "use the Airship Service"; mes "instead. Thank you for your"; @@ -180,7 +211,7 @@ function script F_Kafra { goto M_Menu; } if (@K_Menu0$[@num] == "Rent a Pushcart"){ - if(callfunc("F_KafCart",getarg(0)) == 1) next; + if(callfunc("F_KafCart",getarg(0),getarg(4)) == 1) next; goto M_Menu; } if (@K_Menu0$[@num] == "Guide"){ @@ -197,7 +228,7 @@ function script F_Kafra { end; } if (@K_Menu0$[@num] == "Use Guild Storage"){ - callfunc "F_KafStor",1; + callfunc "F_KafStor",1,0; next; goto M_Menu; } @@ -207,9 +238,10 @@ function script F_Kafra { // Storage Function ======================================================= function script F_KafStor { + // Unable to access Guild Storage (Busy) if(getarg(0) == 1){ if(guildopenstorage(0) == 1){ - mes "[Kafra]"; + mes "[Kafra Employee]"; mes "I'm sorry but another guild member is using the guild storage"; mes "right now. Please wait until that person is finished."; close2; @@ -219,30 +251,74 @@ function script F_KafStor { cutin "", 255; close; } + + // Unable to access Normal Storage (Insufficient Basic Skills) if(basicskillcheck() && getskilllv(1) < 6){ - mes "[Kafra]"; - mes "I am sorry but you have to be at least Novice level 6 if you want to use the storage."; + mes "[Kafra Employee]"; + // Niflheim Specific Message + if (getarg(2) == 1) { + mes "^666666S-s-ssoooorry,"; + mes "y-you're a-a-aaaa"; + mes "Nooviiice... N-neeeds"; + mes "B-basic sssskill l-level 6...^000000"; + return; + } + mes "I'm sorry, but you"; + mes "need the Novice's"; + mes "Basic Skill Level 6 to"; + mes "use the Storage Service."; return; } - //don't charge for common storage in Castle + + // Accessing Normal Storage (Skipped if accessing Storage from Guild castle) if(getarg(0) != 2){ - //we'll use Free Ticket for Kafra Storage if available - if(countitem(7059)){ - delitem 7059,1; - } else { - if(Zeny<40){ - mes "[Kafra]"; - mes "Dear you don't have enough money. The Storage fee is 40 Zeny."; + // Consume "Free Ticket for Kafra Storage" if available. + if(countitem(7059)) delitem 7059,1; + else { + if(Zeny<getarg(1)){ + mes "[Kafra Employee]"; + // Niflheim Specific Message + if (getarg(2) == 1) { + percentheal -50,-50; + mes "^666666Zeeeeeny..."; + mes "M-more z-zeny...!"; + mes "N-neeed 150... zeny..."; + mes "Ergh! T-taking bl-blood~!^000000"; + return; + } + //Standard Message + mes "I'm sorry, but you don't"; + mes "have enough zeny to use"; + mes "the Storage Service. Our"; + mes "Storage access fee is "+getarg(1)+" zeny."; return; } - set Zeny, Zeny-40; - set RESRVPTS, RESRVPTS + (40/5); + set Zeny, Zeny-getarg(1); + set RESRVPTS, RESRVPTS + (getarg(1)/5); } } - mes "[Kafra]"; - mes "Close this window to open your storage."; - mes "We hope to see you again soon."; + // Surpress the "End" message if in guild castle. + if (getarg(0) != 2) { + // Niflheim specific Message + if (getarg(2) == 1) { + percentheal 0,-10; + mes "[Kafra Employee]"; + mes "^666666Thank you.. for... using..."; + mes "Thank you.. for... using..."; + mes "Thank you.. for... using..."; + mes "Thank you.. for... using..."; + mes "Thank you.. for... using...^000000"; + } + // Normal message + else { + mes "[Kafra Employee]"; + mes "Here, let me open"; + mes "your Storage for you."; + mes "Thank you for using"; + mes "the Kafra Service."; + } + } callfunc("F_CheckKafCode"); //check your storage password, if set close2; @@ -254,8 +330,9 @@ function script F_KafStor { // Teleport Function ================================================== function script F_KafTele { - mes "[Kafra]"; - mes "Please set your destination."; + mes "[Kafra Employee]"; + mes "Please choose"; + mes "your destination."; next; menu @wrpC$[0],M_Wrp0, @wrpC$[1],M_Wrp1, @wrpC$[2],M_Wrp2, @wrpC$[3],M_Wrp3, @@ -284,14 +361,16 @@ function script F_KafTele { L_Warp: if (@wrpC$[@num] == "Cancel") return; - // we'll use Free Ticket for Kafra Transportation if available - if(countitem(7060)){ - delitem 7060,1; - } else { + // Consume "Free Ticket for Kafra Transportation" if available. + // Do not consume if in Guild castle + if(countitem(7060) > 0 && getarg(0) != 2) delitem 7060,1; + else { if (Zeny<@wrpP[@num]){ - mes "[Kafra]"; - mes "Dear you don't have enough money. Please check your funds again."; - emotion e_cash; + mes "[Kafra Employee]"; + mes "I'm sorry, but you don't have"; + mes "enough zeny for the Teleport"; + mes "Service. The fee to teleport"; + mes "to "+@wrpD$[@num]+" is "+@wrpP[@num]+" zeny."; close2; cutin "", 255; end; @@ -320,56 +399,59 @@ function script F_KafTele { // Cart Function ======================================================== function script F_KafCart { + // Ensure that the class wanting to rent a pushcart is a merchant if(baseClass != Job_Merchant){ - mes "[Kafra]"; - mes "I'm sorry dear. The Cart service is only provided for the Merchant and Blacksmith Class."; - return 1; - } - if(getskilllv(39)==0){ - mes "[Kafra]"; - mes "I'm sorry but you need the skill ^0000FF'Pushcart'^000000 to rent a cart."; + mes "[Kafra Employee]"; + mes "I'm sorry, but the"; + mes "Pushcart rental service"; + mes "is only available to Merchants,"; + mes "Blacksmiths, Master Smiths,"; + mes "Alchemists and Biochemists."; return 1; } - if(checkcart() == 1){ - mes "[Kafra]"; - mes "Excuse me... but you already have a cart...."; - emotion e_swt; + // Make sure the invoking character does not have a cart already + else if(checkcart() == 1){ + mes "[Kafra Employee]"; + mes "You already have"; + mes "a Pushcart equipped."; + mes "Unfortunately, we can't"; + mes "rent more than one to"; + mes "each customer at a time."; return 1; } - //get Cart in Guild for free - if(getarg(0) == 2) goto L_FreeCart; - //use Free Ticket for the Cart Service if available - if(countitem(7061)){ - delitem 7061,1; - goto L_FreeCart; + + // Consume "Free Ticket for the Cart Service" if available. + // Do not consume if in Guild castle. + if(countitem(7061) > 0 && getarg(0) != 2) delitem 7061,1; + else { + mes "[Kafra Employee]"; + mes "The Pushcart rental"; + mes "fee is "+getarg(1)+" zeny. Would"; + mes "you like to rent a Pushcart?"; + next; + menu "Rent a Pushcart.",-, "Cancel.",M_End; + if(Zeny<getarg(1)){ + mes "[Kafra Employee]"; + mes "I'm sorry, but you"; + mes "don't have enough"; + mes "zeny to pay the Pushcart"; + mes "rental fee of "+getarg(1)+" zeny."; + return 1; + } + set Zeny,Zeny-getarg(1); + set RESRVPTS, RESRVPTS + 48; } - mes "[Kafra]"; - mes "The Cart Fee is 800 Zeny. Do you want to Rent a Cart?"; - next; - menu "-Rent a Cart.",-, "-Cancel.",M_End; + setcart; + return 1; - if(Zeny<800){ - mes "[Kafra]"; - mes "Dear, you don't have enough Money. You need 800 Zeny."; - emotion e_cash; - return 1; - } - set Zeny,Zeny-800; - set RESRVPTS, RESRVPTS + 48; - L_FreeCart: - setcart; - mes "[Kafra]"; - mes "Here is your cart."; - return 1; - M_End: - return 0; +M_End: + return 0; } // Pass Function =============================================================== function script F_KafGuide { - - mes "[Kafra]"; + mes "[Kafra Employee]"; mes "WIP..."; return; } @@ -379,25 +461,26 @@ function script F_KafInfo { sM_Menu: //Uncomment next line to block Kafra Storage Protection -// if(getarg(0) == 0) menu "-Special Reserve Check",sM_ResChk, "-Kafra Locations",sM_KafLoc, "-Cancel",sM_End; - if(getarg(0) == 0) menu "-Special Reserve Check",sM_ResChk, "-Storage Password Service",sM_KafCode, "-Kafra Locations",sM_KafLoc, "-Cancel",sM_End; +// if(getarg(0) == 0) menu "Check Special Reserve Points.",sM_ResChk, "Kafra Employee Locations",sM_KafLoc, "Cancel",sM_End; + if(getarg(0) == 0) menu "Check Special Reserve Points.",sM_ResChk, "Storage Password Service",sM_KafCode, "Kafra Employee Locations",sM_KafLoc, "Cancel",sM_End; sM_ResChk: - mes "[Kafra]"; - mes "Here is your current amount of special reserve points:"; - mes "^0000ff"+RESRVPTS+"^000000."; - next; - mes "[Kafra]"; - mes "Remember to continue using Kafra services such as Storage and Teleport, to earn more special reserve points."; + mes "[Kafra Employee]"; + mes "Let's see..."; + mes strcharinfo(0) + "..."; + mes "Ah, you have a total of"; + mes RESRVPTS+ " Special Reserve Points."; next; - mes "[Kafra]"; - mes "You can trade them in at the Kafra Main Office in Al De Baran for useful items and cool prizes."; + mes "[Kafra Employee]"; + mes "You can exchange your"; + mes "Special Reserve Points for"; + mes "rewards at the Kafra Main Office in Al De Baran. Please use our"; + mes "convenient services to see the benefits of our rewards program."; next; if(getarg(0) == 1) return; goto sM_Menu; + sM_KafLoc: - mes "[Kafra]"; - mes "The flashing signals on your mini-map point to the locations of all of the Kafra Agents in this city."; viewpoint 1,@viewpX[0],@viewpY[0],1,0xFF00FF; viewpoint 1,@viewpX[1],@viewpY[1],2,0xFF00FF; viewpoint 1,@viewpX[2],@viewpY[2],3,0xFF00FF; @@ -420,16 +503,36 @@ function script F_KafInfo { // End Function ===================================================== // arg(0): used to determine what message to display. // arg(1): used to determine if save message is displayed. +// arg(2): used to display the name of the area you're saving in. //=================================================================== function script F_KafEnd { - mes "[Kafra]"; - if(getarg(1)==1) mes "Your respawn point has been saved."; // only shown when a player uses save - if(getarg(0)!=1) mes "Thank you for using Kafra Services. We hope to see you again soon."; - if(getarg(0)==1) mes "We, Kafra Corporation.... Will be with you.... whenever.... wherever... therefore.... please don't forget us....."; + mes "[Kafra Employee]"; + //Save + if(getarg(1)==1) { + mes "[Kafra Employee]"; + mes "Your Respawn Point"; + mes "has been saved here"; + mes getarg(2)+"."; + mes "Thank you for using"; + mes "the Kafra Services."; + } + + // Generic End + else if(getarg(0)==0) { + mes "We, here at Kafra Corporation,"; + mes "are always endeavoring to provide you with the best services. We hope that we meet your adventuring needs and standards of excellence."; + } + + // Niflheim End + else if(getarg(0)==1) { + percentheal 0,- 25; + mes "^666666Kaffffra n-never"; + mes "diiiiiiiiiiiiiies. On..."; + mes "On y-yooour siiiiide~^000000"; + } + close2; cutin "", 255; - emotion e_thx; - close; end; } @@ -452,7 +555,7 @@ function script F_CheckKafCode { // Set / Change / Clear Storage Password Function ==================== function script F_SetKafCode { - mes "[Kafra]"; + mes "[Kafra Employee]"; if(#kafra_code) { mes "Your storage is protected with a password. What would you do now?"; next; @@ -467,7 +570,7 @@ function script F_SetKafCode { "Cancel",M_END; } - mes "[Kafra]"; + mes "[Kafra Employee]"; mes "At first, please enter your ^0000FFold password^000000."; set @code,callfunc("F_EntKafCode"); if(@code==0 || @code != #kafra_code-getcharid(3)-1337) { @@ -478,7 +581,7 @@ function script F_SetKafCode { next; M_SET: - mes "[Kafra]"; + mes "[Kafra Employee]"; mes "Now enter your ^FF0000new password^000000 to protect your storage from thieves."; set @code,callfunc("F_EntKafCode"); if(@code==0) { @@ -487,7 +590,7 @@ M_SET: goto M_END; } next; - mes "[Kafra]"; + mes "[Kafra Employee]"; if(Zeny < 5000) goto L_ZENY; set Zeny,Zeny-5000; set RESRVPTS, RESRVPTS + (5000/50); @@ -499,7 +602,7 @@ M_SET: goto M_END; M_CLEAR: - mes "[Kafra]"; + mes "[Kafra Employee]"; mes "Please, enter your password before its removal."; set @code,callfunc("F_EntKafCode"); if(@code==0) { @@ -508,7 +611,7 @@ M_CLEAR: goto M_END; } next; - mes "[Kafra]"; + mes "[Kafra Employee]"; if(Zeny < 1000) goto L_ZENY; set Zeny,Zeny-1000; set RESRVPTS, RESRVPTS + (1000/50); |