summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-08 18:45:51 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-09-08 18:45:51 +0000
commit7a308b07b92f9aa82b0e3d8dc987d69f3535b7e2 (patch)
tree2b7f00c9f373b187f821c63127187120770f66f1 /src/map/skill.c
parent9e9b198e6d0b810fa52f888b32653b5370fe65b3 (diff)
downloadhercules-7a308b07b92f9aa82b0e3d8dc987d69f3535b7e2.tar.gz
hercules-7a308b07b92f9aa82b0e3d8dc987d69f3535b7e2.tar.bz2
hercules-7a308b07b92f9aa82b0e3d8dc987d69f3535b7e2.tar.xz
hercules-7a308b07b92f9aa82b0e3d8dc987d69f3535b7e2.zip
- Cleaned up SG_HATE to use a new function, pc_set_hate_mob to handle setting.
- Updated pc_authok to initialize all mob_hate vars to -1 - Updated clif_hate_mob to receive the hate-type instead of skill-lv. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8680 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 87df0e1ac..eea144311 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -5409,52 +5409,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break;
case SG_HATE:
- if (sd && skilllv <= 3) {
+ if (sd) {
clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if (sd->hate_mob[skilllv-1] != -1)
- { //Can't change hate targets.
+ if (!pc_set_hate_mob(sd, skilllv-1, bl))
clif_skill_fail(sd,skillid,0,0);
- break;
- }
- if(dstsd) //PC
- {
- sd->hate_mob[skilllv-1] = dstsd->status.class_;
- pc_setglobalreg(sd,"PC_HATE_MOB_STAR",sd->hate_mob[skilllv-1]+1);
- clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
- break;
- }
- if(dstmd) // mob
- {
- if (sd->hate_mob[skilllv-1] || tstatus->size != skilllv-1)
- { //Can't change hate targets / wrong target size
- clif_skill_fail(sd,skillid,0,0);
- break;
- }
- switch(skilllv)
- {
- case 1:
- sd->hate_mob[0] = dstmd->class_;
- pc_setglobalreg(sd,"PC_HATE_MOB_SUN",sd->hate_mob[0]+1);
- clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
- break;
- case 2:
- if (tstatus->max_hp>=6000)
- {
- sd->hate_mob[1] = dstmd->class_;
- pc_setglobalreg(sd,"PC_HATE_MOB_MOON",sd->hate_mob[1]+1);
- clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
- } else clif_skill_fail(sd,skillid,0,0);
- break;
- case 3:
- if (tstatus->max_hp>=20000)
- {
- sd->hate_mob[2] = dstmd->class_;
- pc_setglobalreg(sd,"PC_HATE_MOB_STAR",sd->hate_mob[2]+1);
- clif_hate_mob(sd,skilllv,sd->hate_mob[skilllv-1]);
- } else clif_skill_fail(sd,skillid,0,0);
- break;
- }
- }
}
break;