implemented 3 kafra ptickets for KAfra. removed kafra pass

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8962 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Lupus 2006-10-11 10:39:29 +00:00
parent f91836f32c
commit 5605542ef1
2 changed files with 103 additions and 152 deletions

View File

@ -29,6 +29,12 @@ Playtester
Date Added Date Added
====== ======
10/11
* Removed Free Pass from Kafra [Lupus]
- Now Kafra can use these tickets (Novice Grounds has to be updated!)
7059,Free Ticket for Kafra Storage | 7060,Free Ticket for Kafra Transportation
7061,Free Ticket for the Cart Service
- Added "-Guide" option to Kafra. WIP (some official servers show u a nearest Guide on your mini-map)
10/10 10/10
* Fixed Seals quest [Lupus] * Fixed Seals quest [Lupus]
* Updated Kafra Pavianne [Lupus] * Updated Kafra Pavianne [Lupus]

View File

@ -1,16 +1,15 @@
//===== eAthena Script ======================================= //===== eAthena Script =======================================
//= Kafra Functions //= Kafra Functions
//===== By: ================================================== //===== By: ==================================================
//= Lotsa People (1.0)
//= eAthena Dev Team //= eAthena Dev Team
//= Darlskies, Darkchild, Syrus22, Lupus, kobra_k88 (2.0) //= Darlskies, Darkchild, Syrus22, Lupus, kobra_k88 (2.0)
//===== Current Version: ===================================== //===== Current Version: =====================================
//= 5.3 //= 5.4
//===== Compatible With: ===================================== //===== Compatible With: =====================================
//= eAthena 1.0 //= eAthena 1.0
//===== Description: ========================================= //===== Description: =========================================
//= These functions handle save, storage, cart rental, teleport, //= These functions handle save, storage, cart rental, teleport,
//= and Kafra pass options for all Kafra NPCs. //= and Free Teleport/Warp/Rent Cart options for all Kafra NPCs.
//===== Additional Comments: ================================= //===== Additional Comments: =================================
//= v1.1 Now using functions v2.1 Added Cart Rent for Classes: Whitesmith, Professor. //= 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] //= 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.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.2 By default commented out custom Guilds Kafra's "Guild Storage". [Lupus]
//= 5.3 uncommented Guild Storage. Confirmed kRO feature. [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. //= arg(2): Used to determine if the info menu is shown in F_KafInfo.
//========================================================================== //==========================================================================
function script F_Kafra { function script F_Kafra {
set @kafPass, 0;
callfunc "F_ClearGarbage"; //Clear outdated, unused variables callfunc "F_ClearGarbage"; //Clear outdated, unused variables
mes "[Kafra]"; mes "[Kafra]";
@ -92,24 +92,24 @@ function script F_Kafra {
break; break;
//Common w/o teleport //Common w/o teleport
case 3: 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; break;
//Case 4 is Einbroch no tele message. //Case 4 is Einbroch no tele message.
//Common w/o save and teleport //Common w/o save and teleport
case 5: 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; break;
//Only storage and other info check //Only storage and other info check
case 6: case 6:
setarray @K_Menu0$[0],"-Use Storage","-Other Information Check","-Cancel"; setarray @K_Menu0$[0],"-Guide","-Use Storage","-Other Information Check","-Cancel";
break; break;
//Common Kafra //Common Kafra
default: 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; break;
} }
if(getarg(0)==2) { if(getarg(0)==2) {
//Guilds Kafra //Guilds Kafra (free Teleport, free Storage, Free Cart)
cleararray @K_Menu0$[0],"",7; 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 Cart","-Use Teleport Service","-Cancel";
} }
@ -168,8 +168,8 @@ function script F_Kafra {
if(callfunc("F_KafCart",getarg(0)) == 1) next; if(callfunc("F_KafCart",getarg(0)) == 1) next;
goto M_Menu; goto M_Menu;
} }
if (@K_Menu0$[@num] == "-Kafra Pass"){ if (@K_Menu0$[@num] == "-Guide"){
if(callfunc("F_KafPass") == 1) next; callfunc "F_KafGuide";
goto M_Menu; goto M_Menu;
} }
if (@K_Menu0$[@num] == "-Other Information Check"){ if (@K_Menu0$[@num] == "-Other Information Check"){
@ -191,15 +191,38 @@ function script F_Kafra {
// Storage Function ======================================================= // Storage Function =======================================================
function script F_KafStor { function script F_KafStor {
if(getarg(0) == 1) goto L_Guild; if(getarg(0) == 1){
if(basicskillcheck(0) > 0 && getskilllv(1) < 6) goto sL_JbLvl; if(guildopenstorage(0) == 1){
if(BaseJob == Job_Novice) set @fee, 30; mes "[Kafra]";
if(BaseJob != Job_Novice) set @fee, 60; mes "I'm sorry but another guild member is using the guild storage";
if(@kafPass==1 || getarg(0) == 2) set @fee, 0; mes "right now. Please wait until that person is finished.";
if(Zeny<@fee) goto sL_Zeny; close2;
set Zeny, Zeny-@fee; cutin "", 255;
set RESRVPTS, RESRVPTS + (@fee/5); 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 "[Kafra]";
mes "Close this window to open your storage."; mes "Close this window to open your storage.";
mes "We hope to see you again soon."; mes "We hope to see you again soon.";
@ -210,35 +233,12 @@ function script F_KafStor {
openstorage; openstorage;
cutin "", 255; cutin "", 255;
end; 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 ================================================== // Teleport Function ==================================================
function script F_KafTele { function script F_KafTele {
mes "[Kafra]"; mes "[Kafra]";
if (@kafPass==1) mes "Since you're using a Kafra Pass, any warp is free!";
mes "Please set your destination."; mes "Please set your destination.";
next; next;
@ -268,11 +268,21 @@ function script F_KafTele {
L_Warp: L_Warp:
if (@wrpC$[@num] == "Cancel") return; if (@wrpC$[@num] == "Cancel") return;
if (@kafPass==1) set @wrpP[@num], 0; // we'll use Free Ticket for Kafra Transportation if available
if (Zeny<@wrpP[@num]) goto sL_CantTele; if(countitem(7060)){
set Zeny, Zeny-@wrpP[@num]; delitem 7060,1;
if (@kafPass==0) set RESRVPTS, RESRVPTS + (@wrpP[@num]/16); } 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] == "Alberta") warp "alberta.gat", 117, 56;
if (@wrpD$[@num] == "Al De Baran") warp "aldebaran.gat",143,110; if (@wrpD$[@num] == "Al De Baran") warp "aldebaran.gat",143,110;
if (@wrpD$[@num] == "Aldebaran") 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; if (@wrpD$[@num] == "Yuno") warp "yuno.gat", 157, 123;
cutin "", 255; cutin "", 255;
end; end;
sL_CantTele:
mes "[Kafra]";
mes "Dear you don't have enough money. Please check your funds again.";
close2;
cutin "", 255;
end;
} }
// Cart Function ======================================================== // Cart Function ========================================================
function script F_KafCart { function script F_KafCart {
if(baseClass != Job_Merchant) goto sL_CantRent; if(baseClass != Job_Merchant){
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:
mes "[Kafra]"; mes "[Kafra]";
mes "I'm sorry dear. The Cart service is only provided for the Merchant and Blacksmith Class."; mes "I'm sorry dear. The Cart service is only provided for the Merchant and Blacksmith Class.";
return 1; return 1;
sL_NeedSkill: }
if(getskilllv(39)==0){
mes "[Kafra]"; mes "[Kafra]";
mes "I'm sorry but you need the skill ^0000FF'Pushcart'^000000 to rent a cart."; mes "I'm sorry but you need the skill ^0000FF'Pushcart'^000000 to rent a cart.";
return 1; return 1;
sL_GotCart: }
if(checkcart(0) == 1){
mes "[Kafra]"; mes "[Kafra]";
mes "Excuse me... but you already have a cart...."; mes "Excuse me... but you already have a cart....";
emotion 4; emotion e_swt;
return 1; 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 "[Kafra]";
mes "Dear, you don't have enough Money. You need 800 Zeny."; mes "Here is your cart.";
return 1; return 1;
M_End: M_End:
return 0; return 0;
@ -345,72 +351,11 @@ function script F_KafCart {
// Pass Function =============================================================== // Pass Function ===============================================================
function script F_KafPass { function script F_KafGuide {
sM_Menu: mes "[Kafra]";
menu "Use a Kafra Pass.",-, "What is a Kafra Pass?",sM_PassInfo, "Cancel",sM_End; mes "WIP...";
return;
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;
} }
// Special Reserve Points Function =========================================== // Special Reserve Points Function ===========================================
@ -419,7 +364,7 @@ function script F_KafInfo {
sM_Menu: sM_Menu:
//Uncomment next line to block Kafra Storage Protection //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, "-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: sM_ResChk:
mes "[Kafra]"; mes "[Kafra]";
@ -448,7 +393,7 @@ function script F_KafInfo {
viewpoint 2,@viewpX[3],@viewpY[3],4,0xFF00FF; viewpoint 2,@viewpX[3],@viewpY[3],4,0xFF00FF;
goto sM_Menu; goto sM_Menu;
sM_KafPassword: sM_KafCode:
callfunc("F_SetKafCode"); callfunc("F_SetKafCode");
sM_End: 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....."; if(getarg(0)==1) mes "We, Kafra Corporation.... Will be with you.... whenever.... wherever... therefore.... please don't forget us.....";
close2; close2;
cutin "", 255; cutin "", 255;
emotion 15; emotion e_thx;
close; close;
end; end;
} }