summaryrefslogtreecommitdiff
path: root/npc/custom/eAAC_Scripts/kafraExpress/ke_stats.txt
blob: 1b83fdd7944793ad15e66e4876e1ba85f2b54305 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//===== eAthena Script =======================================
//= Kafra Express - Stat/Reset Module
//===== By: ==================================================
//= Skotlex
//===== Current Version: =====================================
//= 2.2
//===== Compatible With: =====================================
//= eAthena SVN R3424+
//===== Description: =========================================
//= Part of the Kafra Express Script Package.
//= Offers stat raising and Stat/Reset skills
//===== Additional Comments: =================================
//= See config.txt for configuration.
//============================================================

-	script	keInit_stats	{
OnInit:	//Load Config
	donpcevent "keConfig::OnLoadStats";
	end;
}

function	script	F_keStats	{

	function SF_statRaise;

	set @discount,callfunc("F_keCost",100,$@kest_discount);
	do {
		set @kmenu, select(
			"- Return",
			"- Raise Stats",
			"- Reset Stats ("+$@kest_stResetCost+"z+"+$@kest_BaseLvCost+"/blv)",
			"- Reset Skills ("+$@kest_skResetCost+"z+"+$@kest_JobLvCost+"/jlv)",
			"- Reset Both ("+$@kest_resetCost+"z+"+$@kest_BothLvCost+"/lv)"
		);
		switch (@kmenu) {
		case 2: //Stat raising
			SF_statRaise();
			set @cost, 0;
			set @reset, 0;
			break;
		case 3: //Reset Stat
			set @cost, $@kest_stResetCost+BaseLevel*$@kest_BaseLvCost;
			set @reset, 1;
			break;
		case 4: //Reset Skills
			set @cost, $@kest_skResetCost+(JobLevel+jobchange_level)*$@kest_JobLvCost;
			set @reset, 2;
			break;
		case 5: //Reset Both
			set @cost, $@kest_resetCost+(BaseLevel+JobLevel+jobchange_level)*$@kest_BothLvCost;
			set @reset, 3;
			break;
		default: //Cancel
			set @cost, 0;
			set @reset, 0;
			break;
		}
		if (@reset > 0) {
			if (select("- Cancel","- Reset for "+(@cost*@discount/100)+"z") == 2) {
				if (!(callfunc("F_keCharge",@cost,$@kest_discount,1))) { 
					callfunc "F_keIntro", e_an, "Sorry, you don't have enough Zeny.";
				} else {
					if (@reset&1)
						ResetStatus;
					if (@reset&2) {
						if ($@kest_resetBasic)
							ResetSkill;
						else {
							set @skill1,getskilllv(1);
							ResetSkill;
							skill 1,@skill1,0;
							set SkillPoint,SkillPoint-@skill1;
						}
					}
					emotion e_hmm;
				}
			}
		}
	} while (@kmenu > 1);
	return;
	
function SF_statRaise {
	do {
		set @submenu, select(
			"- Return",
			"- Raise Strength",
			"- Raise Agility",
			"- Raise Vitality",
			"- Raise Intelligence",
			"- Raise Dexterity",
			"- Raise Luck"
		);
		switch (@submenu) {
		case 2:
			set @stat,bStr;
			break;
		case 3:
			set @stat,bAgi;
			break;
		case 4:
			set @stat,bVit;
			break;
		case 5:
			set @stat,bInt;
			break;
		case 6:
			set @stat,bDex;
			break;
		case 7:
			set @stat,bLuk;
			break;
		default:
			return;
		}
		input @qty;
		if (@qty <1) {
			callfunc "F_keIntro", e_swt, "I don't lower stats, try resetting them.";
		} else if (@qty >100) {
			callfunc "F_keIntro", e_swt2, "Sorry... I can only raise stats up to 100 at a time.";
		} else {
			do {
				statusup @stat;
				set @qty,@qty-1;
			} while (@qty > 0);
			emotion e_ok;
		}
	} while (@submenu > 1);
}

}