summaryrefslogtreecommitdiff
path: root/npc/kafras/functions_kafras.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/kafras/functions_kafras.txt')
-rw-r--r--npc/kafras/functions_kafras.txt249
1 files changed, 97 insertions, 152 deletions
diff --git a/npc/kafras/functions_kafras.txt b/npc/kafras/functions_kafras.txt
index 6b5c08950..c26506df8 100644
--- a/npc/kafras/functions_kafras.txt
+++ b/npc/kafras/functions_kafras.txt
@@ -1,16 +1,15 @@
//===== eAthena Script =======================================
//= Kafra Functions
//===== By: ==================================================
-//= Lotsa People (1.0)
//= eAthena Dev Team
//= Darlskies, Darkchild, Syrus22, Lupus, kobra_k88 (2.0)
//===== Current Version: =====================================
-//= 5.3
+//= 5.4
//===== Compatible With: =====================================
//= eAthena 1.0
//===== Description: =========================================
-//= These functions handle save, storage, cart rental, teleport,
-//= and Kafra pass options for all Kafra NPCs.
+//= These functions handle save, storage, cart rental, teleport,
+//= and Free Teleport/Warp/Rent Cart options for all Kafra NPCs.
//===== Additional Comments: =================================
//= v1.1 Now using functions v2.1 Added Cart Rent for Classes: Whitesmith, Professor.
//= Replaced checkoption(x) into checkcart(0) [Lupus] v2.1b Added Fix Kafra Pass Func [Kobra_k88]
@@ -36,6 +35,9 @@
//= 5.1a Temporary? Added F_ClearGarbage to clear unused/outdated variables [Lupus]
//= 5.2 By default commented out custom Guilds Kafra's "Guild Storage". [Lupus]
//= 5.3 uncommented Guild Storage. Confirmed kRO feature. [Lupus]
+//= 5.4 added -Guide option (Kafra shows you nearest Guide) Work in progress.
+//= Need all coords for all guides.. and somehow pass their coords to kafra.
+//= Removed universal Kafra Pass, added 3 new Kafra Tickets [Lupus]
//============================================================
@@ -45,8 +47,6 @@
//= arg(2): Used to determine if the info menu is shown in F_KafInfo.
//==========================================================================
function script F_Kafra {
- set @kafPass, 0;
-
callfunc "F_ClearGarbage"; //Clear outdated, unused variables
mes "[Kafra]";
@@ -92,24 +92,24 @@ function script F_Kafra {
break;
//Common w/o teleport
case 3:
- setarray @K_Menu0$[0],"-Save","-Use Storage","-Rent a Cart","-Kafra Pass","-Other Information Check","-Cancel";
+ setarray @K_Menu0$[0],"-Guide","-Save","-Use Storage","-Rent a Cart","-Kafra Pass","-Other Information Check","-Cancel";
break;
//Case 4 is Einbroch no tele message.
//Common w/o save and teleport
case 5:
- setarray @K_Menu0$[0],"-Use Storage","-Rent a Cart","-Kafra Pass","-Other Information Check","-Cancel";
+ setarray @K_Menu0$[0],"-Guide","-Use Storage","-Rent a Cart","-Kafra Pass","-Other Information Check","-Cancel";
break;
//Only storage and other info check
case 6:
- setarray @K_Menu0$[0],"-Use Storage","-Other Information Check","-Cancel";
+ setarray @K_Menu0$[0],"-Guide","-Use Storage","-Other Information Check","-Cancel";
break;
//Common Kafra
default:
- setarray @K_Menu0$[0],"-Save","-Use Storage","-Use Teleport Service","-Rent a Cart","-Kafra Pass","-Other Information Check","-Cancel";
+ setarray @K_Menu0$[0],"-Guide","-Save","-Use Storage","-Use Teleport Service","-Rent a Cart","-Kafra Pass","-Other Information Check","-Cancel";
break;
}
if(getarg(0)==2) {
- //Guilds Kafra
+ //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";
}
@@ -168,8 +168,8 @@ function script F_Kafra {
if(callfunc("F_KafCart",getarg(0)) == 1) next;
goto M_Menu;
}
- if (@K_Menu0$[@num] == "-Kafra Pass"){
- if(callfunc("F_KafPass") == 1) next;
+ if (@K_Menu0$[@num] == "-Guide"){
+ callfunc "F_KafGuide";
goto M_Menu;
}
if (@K_Menu0$[@num] == "-Other Information Check"){
@@ -191,15 +191,38 @@ function script F_Kafra {
// Storage Function =======================================================
function script F_KafStor {
- if(getarg(0) == 1) goto L_Guild;
- if(basicskillcheck(0) > 0 && getskilllv(1) < 6) goto sL_JbLvl;
- if(BaseJob == Job_Novice) set @fee, 30;
- if(BaseJob != Job_Novice) set @fee, 60;
- if(@kafPass==1 || getarg(0) == 2) set @fee, 0;
- if(Zeny<@fee) goto sL_Zeny;
- set Zeny, Zeny-@fee;
- set RESRVPTS, RESRVPTS + (@fee/5);
-
+ if(getarg(0) == 1){
+ if(guildopenstorage(0) == 1){
+ mes "[Kafra]";
+ mes "I'm sorry but another guild member is using the guild storage";
+ mes "right now. Please wait until that person is finished.";
+ close2;
+ cutin "", 255;
+ end;
+ }
+ cutin "", 255;
+ close;
+ }
+ if(basicskillcheck(0) && 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.";
+ return;
+ }
+ //don't charge for common storage in 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.";
+ return;
+ }
+ set Zeny, Zeny-40;
+ set RESRVPTS, RESRVPTS + (40/5);
+ }
+ }
mes "[Kafra]";
mes "Close this window to open your storage.";
mes "We hope to see you again soon.";
@@ -210,35 +233,12 @@ function script F_KafStor {
openstorage;
cutin "", 255;
end;
-
- sL_JbLvl:
- mes "[Kafra]";
- mes "I am sorry but you have to be at least Novice level 6 if you want to use the storage.";
- return;
- sL_Zeny:
- mes "[Kafra]";
- mes "Dear you don't have enough money. The Storage fee is "+@fee+" Zeny.";
- return;
-L_Guild:
- if(guildopenstorage(0) == 1) goto L_InUse;
- cutin "", 255;
- close;
-
- L_InUse:
- mes "[Kafra]";
- mes "I'm sorry but another guild member is using the guild storage";
- mes "right now. Please wait until that person is finished.";
- close2;
- cutin "", 255;
- end;
-
}
// Teleport Function ==================================================
function script F_KafTele {
mes "[Kafra]";
- if (@kafPass==1) mes "Since you're using a Kafra Pass, any warp is free!";
mes "Please set your destination.";
next;
@@ -268,11 +268,21 @@ function script F_KafTele {
L_Warp:
if (@wrpC$[@num] == "Cancel") return;
- if (@kafPass==1) set @wrpP[@num], 0;
- if (Zeny<@wrpP[@num]) goto sL_CantTele;
- set Zeny, Zeny-@wrpP[@num];
- if (@kafPass==0) set RESRVPTS, RESRVPTS + (@wrpP[@num]/16);
-
+ // we'll use Free Ticket for Kafra Transportation if available
+ if(countitem(7060)){
+ 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;
+ close2;
+ cutin "", 255;
+ end;
+ }
+ set Zeny, Zeny-@wrpP[@num];
+ set RESRVPTS, RESRVPTS + (@wrpP[@num]/16);
+ }
if (@wrpD$[@num] == "Alberta") warp "alberta.gat", 117, 56;
if (@wrpD$[@num] == "Al De Baran") warp "aldebaran.gat",143,110;
if (@wrpD$[@num] == "Aldebaran") warp "aldebaran.gat",143,110;
@@ -289,55 +299,51 @@ function script F_KafTele {
if (@wrpD$[@num] == "Yuno") warp "yuno.gat", 157, 123;
cutin "", 255;
end;
-
- sL_CantTele:
- mes "[Kafra]";
- mes "Dear you don't have enough money. Please check your funds again.";
- close2;
- cutin "", 255;
- end;
}
// Cart Function ========================================================
function script F_KafCart {
- if(baseClass != Job_Merchant) goto sL_CantRent;
- if(getskilllv(39)==0) goto sL_NeedSkill;
- if(checkcart(0) == 1) goto sL_GotCart;
- if(getarg(0) == 2) goto L_Guild;
- mes "[Kafra]";
- if(@kafPass==0) mes "The Cart Fee is 800 Zeny. Do you want to Rent a Cart?";
- else mes "Since you're using a Kafra Pass, you can rent a cart for free!";
- next;
- menu "-Rent a Cart.",-, "-Cancel.",M_End;
-
- if(Zeny<800 && kafPass==0) goto sL_CartFee;
- if(@kafPass==0) {
- set Zeny,Zeny-800;
- if(@kafPass==0) set RESRVPTS, RESRVPTS + 48;
- }
- L_Guild:
- setcart;
- mes "[Kafra]";
- mes "Here is your cart.";
- return 1;
-
- sL_CantRent:
+ 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;
- sL_NeedSkill:
+ }
+ if(getskilllv(39)==0){
mes "[Kafra]";
mes "I'm sorry but you need the skill ^0000FF'Pushcart'^000000 to rent a cart.";
return 1;
- sL_GotCart:
+ }
+ if(checkcart(0) == 1){
mes "[Kafra]";
mes "Excuse me... but you already have a cart....";
- emotion 4;
+ emotion e_swt;
return 1;
- sL_CartFee:
+ }
+ //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;
+ }
+ mes "[Kafra]";
+ mes "The Cart Fee is 800 Zeny. Do you want to Rent a Cart?";
+ next;
+ menu "-Rent a Cart.",-, "-Cancel.",M_End;
+
+ 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 "Dear, you don't have enough Money. You need 800 Zeny.";
+ mes "Here is your cart.";
return 1;
M_End:
return 0;
@@ -345,72 +351,11 @@ function script F_KafCart {
// Pass Function ===============================================================
-function script F_KafPass {
+function script F_KafGuide {
- sM_Menu:
- menu "Use a Kafra Pass.",-, "What is a Kafra Pass?",sM_PassInfo, "Cancel",sM_End;
-
- mes "[Kafra]";
- mes "Let me just check your pass.....";
- next;
- if(usedKafPass==0 && countitem(1084)<1) goto sL_NeedPass;
- set @kafPass,1;
- set usedKafPass, usedKafPass + 1;
- if(usedKafPass>=3) goto sL_PassExpire;
- if(usedKafPass > 1) goto L_Cont; //fixed Lupus
- delitem 1084,1;
- mes "(you hand her your pass)";
- next;
- mes "[Kafra]";
- mes "Great! Everything seems to be in order. Now that your pass is activated, you may rent a cart or use the teleport services for free.";
- mes "Your pass number has been entered into our database so you no longer need it.";
- next;
-
- L_Cont:
- mes "[Kafra]";
- mes "You will be able to use the Cart Rental and Teleport services free of charge ^5533FF"+(3 - usedKafPass)+"^000000 more times with any Kafra service agent you choose.";
- return 1;
-
- sL_NeedPass:
- mes "[Kafra]";
- mes "I'm sorry but you don't have a kafra pass to use....";
- next;
- goto sM_Menu;
- sL_PassExpire:
- mes "[Kafra]";
- mes "This is going to be the 3rd and final time you use this pass, therefore it is now expired.";
- next;
- set usedKafPass,0;
- mes "[Kafra]";
- mes "You may now use the Teleport and Cart Rental services for free.";
- return 1;
- sM_PassInfo:
- mes "[Kafra]";
- mes "A ^5533FFKafra Pass^000000 is a unique voucher that lets you use Kafra services for free!";
- mes "The Kafra services that you may use for free are the ^FF3355Teleport^000000 service and the ^FF3355Cart Rental^000000 service.";
- next;
- mes "[Kafra]";
- mes "Kafra passes can be purchased at the Kafra Corp. Main office in Al De Baran.";
- next;
- mes "[Kafra]";
- mes "To use a Kafra Pass, simply choose the option to 'Use a Kafra Pass', when speaking with a Kafra agent such as myself.";
- mes "Your pass number will be entered into our database, and you will then be able to use the Teleport, and Cart Rental Kafra services free of charge.";
- next;
- mes "[Kafra]";
- mes "Once you have finished using the desired services, and have stopped interacting with the Kafra, your 'free use' session will end.";
- mes "You will have a total of ^5533FF 3 'free use' sessions^000000 available upon activation of your Kafra Pass.";
- next;
- mes "[Kafra]";
- mes "To begin another 'free use' session, simply select the 'Use a Kafra Pass' option when speaking with a Kafra Agent.";
- next;
- mes "[Kafra]";
- mes "Believe me when I say that the Kafra Pass is a great bargain!!";
- mes "With the Kafra Pass, we hope to give players some incentive to use our great services.";
- next;
- goto sM_Menu;
-
- sM_End:
- return 0;
+ mes "[Kafra]";
+ mes "WIP...";
+ return;
}
// Special Reserve Points Function ===========================================
@@ -419,7 +364,7 @@ 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_KafPassword, "-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;
sM_ResChk:
mes "[Kafra]";
@@ -448,7 +393,7 @@ function script F_KafInfo {
viewpoint 2,@viewpX[3],@viewpY[3],4,0xFF00FF;
goto sM_Menu;
- sM_KafPassword:
+ sM_KafCode:
callfunc("F_SetKafCode");
sM_End:
@@ -467,7 +412,7 @@ function script F_KafEnd {
if(getarg(0)==1) mes "We, Kafra Corporation.... Will be with you.... whenever.... wherever... therefore.... please don't forget us.....";
close2;
cutin "", 255;
- emotion 15;
+ emotion e_thx;
close;
end;
}