summaryrefslogtreecommitdiff
path: root/npc/other/Global_Functions.txt
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-07 10:23:30 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-07 10:23:30 +0000
commit0d2dd3980827fa6bd3a53526d4dfe740c9ecf2a9 (patch)
tree3fb2622be64f7d390cb4c6e93e33bf05bff0b1c6 /npc/other/Global_Functions.txt
parent3449f67a5458e8ec87027e3bfc50af30ac7b5397 (diff)
downloadhercules-0d2dd3980827fa6bd3a53526d4dfe740c9ecf2a9.tar.gz
hercules-0d2dd3980827fa6bd3a53526d4dfe740c9ecf2a9.tar.bz2
hercules-0d2dd3980827fa6bd3a53526d4dfe740c9ecf2a9.tar.xz
hercules-0d2dd3980827fa6bd3a53526d4dfe740c9ecf2a9.zip
added functions to completely save/load of quest skills
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7028 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc/other/Global_Functions.txt')
-rw-r--r--npc/other/Global_Functions.txt43
1 files changed, 42 insertions, 1 deletions
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt
index 798416a66..666f1fa43 100644
--- a/npc/other/Global_Functions.txt
+++ b/npc/other/Global_Functions.txt
@@ -3,7 +3,7 @@
//===== By: ==================================================
//= Lupus, kobra_k88
//===== Current Version: =====================================
-//= 1.9
+//= 1.91
//===== Compatible With: =====================================
//= eAthena 1.0
//===== Description: =========================================
@@ -20,6 +20,7 @@
//= 1.7 Added "F_ItemName" function, added a great sample for "F_ItemName"
//= 1.8 Added Job Vars clear for Extended classes: TK,SL,SG [Lupus]
//= 1.9 Added "F_ClearGarbage" func that clears outdated, wasted variables [Lupus]
+//= 1.91 Added "F_SaveQuestSkills","F_Load?Skills" functions [Lupus]
//============================================================
@@ -70,6 +71,7 @@ function script F_ClearGarbage {
if(nif_q_done) {set nif_q_done,0; set MISC_QUEST,MISC_QUEST | 64;}
if(MORGEN >= 2) {set MISC_QUEST,MISC_QUEST | 4;}
set MORGEN,0; set nif_t,0;
+ //set QSK1,0; set QSK2,0; set QSK3,0; set QSK4,0;
return;
}
@@ -410,3 +412,42 @@ function script getJobName {
return "omghaxor";
}
}
+
+//////////////////////////////////////////////////////////////////////////////////
+// *** Function "F_SaveQuestSkills": Store learnt quest skills
+//////////////////////////////////////////////////////////////////////////////////
+function script F_SaveQuestSkills {
+ set ADV_QSK,0;
+ //1st classes quest skills
+ for(set @i, 0; @i < 14; set @i, @i + 1){
+ if(getskilllv(144+@i)) set ADV_QSK,ADV_QSK|pow(2,@i);
+ }
+ //2nd classes quest skills
+ for(set @i, 0; @i < 19; set @i, @i + 1){
+ if(getskilllv(1001+@i)) set ADV_QSK,ADV_QSK|pow(2,14+@i);
+ }
+ return;
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+// *** Function "F_Load1Skills": Restore learnt 1st class quest skills
+//////////////////////////////////////////////////////////////////////////////////
+function script F_Load1Skills {
+ //1st classes quest skills
+ for(set @i, 0; @i < 14; set @i, @i + 1){
+ if(ADV_QSK|pow(2,@i) == ADV_QSK) skill 144+@i,1,0;
+ }
+ return;
+}
+
+//////////////////////////////////////////////////////////////////////////////////
+// *** Function "F_Load2Skills": Restore learnt 2nd class quest skills
+//////////////////////////////////////////////////////////////////////////////////
+function script F_Load2Skills {
+ //2nd classes quest skills
+ for(set @i, 0; @i < 19; set @i, @i + 1){
+ if(ADV_QSK|pow(2,14+@i) == ADV_QSK) skill 1001+@i,1,0;
+ }
+ set ADV_QSK,0; //Clear var
+ return;
+} \ No newline at end of file