summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-21 13:35:59 +0100
committerHaru <haru@dotalux.com>2015-01-23 03:53:38 +0100
commit5e4e0603799f170dcf985a57933110cd6ba3017a (patch)
treef334cbaf77b5cc54059c37f1a1b4463197682c5b /src
parent69c90e54ae1ee7374c59d65c91f0d20ce628ec9e (diff)
downloadhercules-5e4e0603799f170dcf985a57933110cd6ba3017a.tar.gz
hercules-5e4e0603799f170dcf985a57933110cd6ba3017a.tar.bz2
hercules-5e4e0603799f170dcf985a57933110cd6ba3017a.tar.xz
hercules-5e4e0603799f170dcf985a57933110cd6ba3017a.zip
Merged petskillattack and petskillattack2.
Existing custom scripts will need edits. In a nutshell: - Existing calls to `petskillattack` should be changed to specify an extra <number of attacks> argument (after <skill level>), set to 0. - Existing calls to `petskillattack2` should be changed to `petskillattack`, keeping the same arguments. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c44
1 files changed, 9 insertions, 35 deletions
diff --git a/src/map/script.c b/src/map/script.c
index b098ed899..fc43aa94a 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -12731,51 +12731,26 @@ BUILDIN(petrecovery)
}
/*==========================================
- * pet attack skills [Valaris] //Rewritten by [Skotlex]
- *------------------------------------------*/
-/// petskillattack <skill id>,<level>,<rate>,<bonusrate>
-/// petskillattack "<skill name>",<level>,<rate>,<bonusrate>
-BUILDIN(petskillattack) {
- struct pet_data *pd;
- TBL_PC *sd=script->rid2sd(st);
-
- if(sd==NULL || sd->pd==NULL)
- return true;
-
- pd=sd->pd;
- if (pd->a_skill == NULL)
- pd->a_skill = (struct pet_skill_attack *)aMalloc(sizeof(struct pet_skill_attack));
-
- pd->a_skill->id=( script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
- pd->a_skill->lv=script_getnum(st,3);
- pd->a_skill->div_ = 0;
- pd->a_skill->rate=script_getnum(st,4);
- pd->a_skill->bonusrate=script_getnum(st,5);
-
- return true;
-}
-
-/*==========================================
* pet attack skills [Valaris]
*------------------------------------------*/
-/// petskillattack2 <skill id>,<level>,<div>,<rate>,<bonusrate>
-/// petskillattack2 "<skill name>",<level>,<div>,<rate>,<bonusrate>
-BUILDIN(petskillattack2) {
+/// petskillattack <skill id>,<level>,<div>,<rate>,<bonusrate>
+/// petskillattack "<skill name>",<level>,<div>,<rate>,<bonusrate>
+BUILDIN(petskillattack) {
struct pet_data *pd;
TBL_PC *sd=script->rid2sd(st);
- if(sd==NULL || sd->pd==NULL)
+ if (sd==NULL || sd->pd==NULL)
return true;
pd=sd->pd;
if (pd->a_skill == NULL)
pd->a_skill = (struct pet_skill_attack *)aMalloc(sizeof(struct pet_skill_attack));
- pd->a_skill->id=( script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
- pd->a_skill->lv=script_getnum(st,3);
+ pd->a_skill->id = script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2);
+ pd->a_skill->lv = script_getnum(st,3);
pd->a_skill->div_ = script_getnum(st,4);
- pd->a_skill->rate=script_getnum(st,5);
- pd->a_skill->bonusrate=script_getnum(st,6);
+ pd->a_skill->rate = script_getnum(st,5);
+ pd->a_skill->bonusrate = script_getnum(st,6);
return true;
}
@@ -19378,8 +19353,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(petskillbonus,"iiii"), // [Valaris]
BUILDIN_DEF(petrecovery,"ii"), // [Valaris]
BUILDIN_DEF(petloot,"i"), // [Valaris]
- BUILDIN_DEF(petskillattack,"viii"), // [Skotlex]
- BUILDIN_DEF(petskillattack2,"viiii"), // [Valaris]
+ BUILDIN_DEF(petskillattack,"viiii"), // [Skotlex]
BUILDIN_DEF(petskillsupport,"viiii"), // [Skotlex]
BUILDIN_DEF(skilleffect,"vi"), // skill effect [Celest]
BUILDIN_DEF(npcskilleffect,"viii"), // npc skill effect [Valaris]