//Le Livre d'Ymir http://www.bookofymir.net/ //traduit par Myllena //===== 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 -1,{ OnInit: //Load Config donpcevent "keConfig::OnLoadStatMarket"; end; } function script F_keStatMarket { set @discount,callfunc("F_keCost",100,$@kesm_discount); do { set @kmenu, select ( "- Retour", "- Acheter un Point de Statistique ("+($@kesm_stBuyPrice*@discount/100)+"z/point)", "- Vendre un Point de Statistique (jusqu'à "+StatusPoint+"/"+$@kesm_stSellPrice+"z/point)", "- Acheter un Point de Compétence ("+($@kesm_skBuyPrice*@discount/100)+"z/point)", "- Vendre un Point de Compétence (jusqu'à "+SkillPoint+"/"+$@kesm_skSellPrice+"z/point)", "- Echanger des Stats contre des Compétences ("+$@kesm_skTradePrice+" stats/skill)", "- Echanger des Compétences contre des 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, "C'est censé me faire rire?"; else callfunc "F_keIntro", e_dots, "Ce n'est pas assez pour acheter un seul point de compétence..."; } else if (@qty > @max) { if (@max == 9999) callfunc "F_keIntro", e_X, "Vous ne pouvez pas en acheter autant!"; else callfunc "F_keIntro", e_X, "Vous n'en avez pas assez pour vendre tout ça..."; } else if (@cost < 0) { callfunc "F_keIntro", e_swt2, "C'est beaucoup trop pour une seule transaction! Essayez d'entrer une quantité plus raisonnable..."; } else { switch(@kmenu) { case 2: //Buy Stat if (!(callfunc("F_keCharge",@cost,$@kesm_discount,1))) { callfunc "F_keIntro", e_X, "Vous n'avez pas assez d'argent pour acheter tout ça."; 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, "Vous n'avez pas assez d'argent pour acheter tout ça."; 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; }