summaryrefslogtreecommitdiff
path: root/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt
diff options
context:
space:
mode:
authorVicious <Vicious@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 18:50:09 +0000
committerVicious <Vicious@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 18:50:09 +0000
commit430f60e0b89f43358026ff1a170ac8938a534244 (patch)
tree6094005321b26405258b47ce4a4de6a8ae33d806 /npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt
parent32ebde394d7762fdbb28ba9b5c3ce9a232292bb7 (diff)
downloadhercules-430f60e0b89f43358026ff1a170ac8938a534244.tar.gz
hercules-430f60e0b89f43358026ff1a170ac8938a534244.tar.bz2
hercules-430f60e0b89f43358026ff1a170ac8938a534244.tar.xz
hercules-430f60e0b89f43358026ff1a170ac8938a534244.zip
eACC scripts.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5429 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt')
-rw-r--r--npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt128
1 files changed, 128 insertions, 0 deletions
diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt
new file mode 100644
index 000000000..c29c59559
--- /dev/null
+++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_statmarket.txt
@@ -0,0 +1,128 @@
+//===== eAthena Script =======================================
+//= Kafra Expres - Stat/Skill Market Module
+//===== By: ==================================================
+//= Skotlex
+//===== Current Version: =====================================
+//= 2.0
+//===== Compatible With: =====================================
+//= eAthena SVN R3579+
+//===== Description: =========================================
+//= Part of the Kafra Express Script Package.
+//= Lets players buy/sell skill points/stat points
+//===== Additional Comments: =================================
+//= See config.txt for configuration.
+//============================================================
+
+- script keInit_statmarket {
+OnInit: //Load Config
+ donpcevent "keConfig::OnLoadStatMarket";
+ end;
+}
+
+function script F_keStatMarket {
+ set @discount,callfunc("F_keCost",100,$@kesm_discount);
+ do {
+ set @kmenu, select (
+ "- Return",
+ "- Buy Stat points ("+($@kesm_stBuyPrice*@discount/100)+"z each)",
+ "- Sell Stat points (up to "+StatusPoint+"/"+$@kesm_stSellPrice+"z each)",
+ "- Buy Skill points ("+($@kesm_skBuyPrice*@discount/100)+"z each)",
+ "- Sell Skill points (up to "+SkillPoint+"/"+$@kesm_skSellPrice+"z each)",
+ "- Trade Stats -> Skill ("+$@kesm_skTradePrice+" stats/skill)",
+ "- Trade Skills -> Stats ("+$@kesm_stTradePrice+" stats/skill)"
+ );
+ if (@kmenu > 1)
+ input @qty;
+ switch (@kmenu) {
+ case 2: //Buy Stat
+ set @min, 1;
+ set @max, 9999;
+ set @cost, @qty*$@kesm_stBuyPrice;
+ break;
+ case 3: //Sell Stat
+ input @qty;
+ set @min, 1;
+ set @max, StatusPoint;
+ set @cost, @qty*$@kesm_stSellPrice;
+ break;
+ case 4: //Buy Skill
+ set @min, 1;
+ set @max, 9999;
+ set @cost, @qty*$@kesm_skBuyPrice;
+ break;
+ case 5: //Sell Skill
+ set @min, 1;
+ set @max, SkillPoint;
+ set @cost, @qty*$@kesm_skSellPrice;
+ break;
+ case 6: //Convert stats -> skills
+ set @min, $@kesm_skTradePrice;
+ set @max, StatusPoint;
+ set @cost, @qty/$@kesm_skTradePrice;
+ break;
+ case 7: //Convert skills -> stats
+ set @min, 1;
+ set @max, SkillPoint;
+ set @cost, @qty*$@kesm_stTradePrice;
+ break;
+ default:
+ return;
+ }
+ if (@qty < @min) {
+ if (@min == 1)
+ callfunc "F_keIntro", e_dots, "Was that supposed to be funny?";
+ else
+ callfunc "F_keIntro", e_dots, "That is not enough to buy a single skill...";
+ } else
+ if (@qty > @max) {
+ if (@max == 9999)
+ callfunc "F_keIntro", e_X, "You can't buy that much!";
+ else
+ callfunc "F_keIntro", e_X, "You don't have that many to sell...";
+ } else
+ if (@cost < 0) {
+ callfunc "F_keIntro", e_swt2, "That is too much for a single transaction! Try a smaller quantity... please?";
+ } else {
+ switch(@kmenu) {
+ case 2: //Buy Stat
+ if (!(callfunc("F_keCharge",@cost,$@kesm_discount,1))) {
+ callfunc "F_keIntro", e_X, "You do not have enough zeny to buy that much.";
+ break;
+ }
+ set StatusPoint,StatusPoint+@qty;
+ emotion e_oh;
+ break;
+ case 3: //Sell Stat
+ set StatusPoint,StatusPoint-@qty;
+ set Zeny,Zeny+@cost;
+ emotion e_oh;
+ break;
+ case 4: //Buy Skill
+ if (!(callfunc("F_keCharge",@cost,$@kesm_discount,1))) {
+ callfunc "F_keIntro", e_X, "You do not have enough zeny to buy that much.";
+ break;
+ }
+ set SkillPoint,SkillPoint+@qty;
+ emotion e_oh;
+ break;
+ case 5: //Sell Skill
+ set SkillPoint,SkillPoint-@qty;
+ set Zeny,Zeny+@cost;
+ emotion e_oh;
+ break;
+ case 6: //Convert stats -> skills
+ set @qty, @cost*$@kesm_skTradePrice;
+ set StatusPoint,StatusPoint-@qty;
+ set SkillPoint,SkillPoint+@cost;
+ emotion e_oh;
+ break;
+ case 7: //Convert skills -> stats
+ set SkillPoint,SkillPoint-@qty;
+ set StatusPoint,StatusPoint+@cost;
+ emotion e_oh;
+ break;
+ }
+ }
+ } while (@kmenu > 1);
+ return;
+}