- More code for mercenaries and starting work on restrictions.
* Heal and Sanctuary skills have their effectiveness on mercenaries reduced by 50%. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13183 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
3d3946138a
commit
c562d05efc
@ -99,6 +99,7 @@ int battle_gettarget(struct block_list* bl)
|
|||||||
case BL_MOB: return ((struct mob_data*)bl)->target_id;
|
case BL_MOB: return ((struct mob_data*)bl)->target_id;
|
||||||
case BL_PET: return ((struct pet_data*)bl)->target_id;
|
case BL_PET: return ((struct pet_data*)bl)->target_id;
|
||||||
case BL_HOM: return ((struct homun_data*)bl)->ud.target;
|
case BL_HOM: return ((struct homun_data*)bl)->ud.target;
|
||||||
|
case BL_MER: return ((struct mercenary_data*)bl)->ud.target;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3315,19 +3316,18 @@ bool battle_check_range(struct block_list *src,struct block_list *bl,int range)
|
|||||||
nullpo_retr(false, src);
|
nullpo_retr(false, src);
|
||||||
nullpo_retr(false, bl);
|
nullpo_retr(false, bl);
|
||||||
|
|
||||||
if(src->m != bl->m) // 違うマップ
|
if( src->m != bl->m )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( !check_distance_bl(src, bl, range) )
|
if( !check_distance_bl(src, bl, range) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if((d=distance_bl(src, bl)) < 2) //No need for path checking.
|
if( (d = distance_bl(src, bl)) < 2 )
|
||||||
return true;
|
return true; // No need for path checking.
|
||||||
|
|
||||||
if( d > AREA_SIZE )
|
if( d > AREA_SIZE )
|
||||||
return false; // Avoid targetting objects beyond your range of sight.
|
return false; // Avoid targetting objects beyond your range of sight.
|
||||||
|
|
||||||
// ?瘧Q物判定
|
|
||||||
return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL);
|
return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2946,7 +2946,7 @@ int do_final_npc(void)
|
|||||||
if ((bl = map_id2bl(i))){
|
if ((bl = map_id2bl(i))){
|
||||||
if (bl->type == BL_NPC)
|
if (bl->type == BL_NPC)
|
||||||
npc_unload((struct npc_data *)bl);
|
npc_unload((struct npc_data *)bl);
|
||||||
else if (bl->type&(BL_MOB|BL_PET|BL_HOM))
|
else if (bl->type&(BL_MOB|BL_PET|BL_HOM|BL_MER))
|
||||||
unit_free(bl, 0);
|
unit_free(bl, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12223,6 +12223,7 @@ BUILDIN_FUNC(rid2name)
|
|||||||
case BL_NPC: script_pushstrcopy(st,((TBL_NPC*)bl)->exname); break;
|
case BL_NPC: script_pushstrcopy(st,((TBL_NPC*)bl)->exname); break;
|
||||||
case BL_PET: script_pushstrcopy(st,((TBL_PET*)bl)->pet.name); break;
|
case BL_PET: script_pushstrcopy(st,((TBL_PET*)bl)->pet.name); break;
|
||||||
case BL_HOM: script_pushstrcopy(st,((TBL_HOM*)bl)->homunculus.name); break;
|
case BL_HOM: script_pushstrcopy(st,((TBL_HOM*)bl)->homunculus.name); break;
|
||||||
|
case BL_MER: script_pushstrcopy(st,((TBL_MER*)bl)->db->name); break;
|
||||||
default:
|
default:
|
||||||
ShowError("buildin_rid2name: BL type unknown.\n");
|
ShowError("buildin_rid2name: BL type unknown.\n");
|
||||||
script_pushconststr(st,"");
|
script_pushconststr(st,"");
|
||||||
|
@ -275,6 +275,9 @@ int skill_calc_heal (struct block_list *src, struct block_list *target, int skil
|
|||||||
if(src->type == BL_HOM && (skill = merc_hom_checkskill(((TBL_HOM*)src), HLIF_BRAIN)) > 0)
|
if(src->type == BL_HOM && (skill = merc_hom_checkskill(((TBL_HOM*)src), HLIF_BRAIN)) > 0)
|
||||||
heal += heal * skill * 2 / 100;
|
heal += heal * skill * 2 / 100;
|
||||||
|
|
||||||
|
if(src->type == BL_MER)
|
||||||
|
heal /= 2;
|
||||||
|
|
||||||
sc = status_get_sc(target);
|
sc = status_get_sc(target);
|
||||||
if( sc && sc->count )
|
if( sc && sc->count )
|
||||||
{
|
{
|
||||||
@ -6842,11 +6845,11 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
|
|||||||
case UNT_SANCTUARY:
|
case UNT_SANCTUARY:
|
||||||
if( battle_check_undead(tstatus->race, tstatus->def_ele) || tstatus->race==RC_DEMON )
|
if( battle_check_undead(tstatus->race, tstatus->def_ele) || tstatus->race==RC_DEMON )
|
||||||
{ //Only damage enemies with offensive Sanctuary. [Skotlex]
|
{ //Only damage enemies with offensive Sanctuary. [Skotlex]
|
||||||
if(battle_check_target(&src->bl,bl,BCT_ENEMY)>0 &&
|
if( battle_check_target(&src->bl,bl,BCT_ENEMY) > 0 && skill_attack(BF_MAGIC, ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0) )
|
||||||
skill_attack(BF_MAGIC, ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0))
|
sg->val1 -= 2; // reduce healing count if this was meant for damaging [hekate]
|
||||||
// reduce healing count if this was meant for damaging [hekate]
|
}
|
||||||
sg->val1 -= 2;
|
else
|
||||||
} else {
|
{
|
||||||
int heal = sg->val2;
|
int heal = sg->val2;
|
||||||
if( tstatus->hp >= tstatus->max_hp )
|
if( tstatus->hp >= tstatus->max_hp )
|
||||||
break;
|
break;
|
||||||
@ -6857,8 +6860,11 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
|
|||||||
if( tsc->data[SC_CRITICALWOUND] )
|
if( tsc->data[SC_CRITICALWOUND] )
|
||||||
heal -= heal * tsc->data[SC_CRITICALWOUND]->val2 / 100;
|
heal -= heal * tsc->data[SC_CRITICALWOUND]->val2 / 100;
|
||||||
}
|
}
|
||||||
|
if( bl->type == BL_MER )
|
||||||
|
heal /= 2;
|
||||||
if( status_isimmune(bl) )
|
if( status_isimmune(bl) )
|
||||||
heal = 0; /* 黄金蟲カード(ヒール量0) */
|
heal = 0;
|
||||||
|
|
||||||
clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
|
clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
|
||||||
status_heal(bl, heal, 0, 0);
|
status_heal(bl, heal, 0, 0);
|
||||||
if( diff >= 500 )
|
if( diff >= 500 )
|
||||||
|
@ -4089,6 +4089,7 @@ int status_get_class(struct block_list *bl)
|
|||||||
case BL_MOB: return ((TBL_MOB*)bl)->vd->class_; //Class used on all code should be the view class of the mob.
|
case BL_MOB: return ((TBL_MOB*)bl)->vd->class_; //Class used on all code should be the view class of the mob.
|
||||||
case BL_PET: return ((TBL_PET*)bl)->pet.class_;
|
case BL_PET: return ((TBL_PET*)bl)->pet.class_;
|
||||||
case BL_HOM: return ((TBL_HOM*)bl)->homunculus.class_;
|
case BL_HOM: return ((TBL_HOM*)bl)->homunculus.class_;
|
||||||
|
case BL_MER: return ((TBL_MER*)bl)->mercenary.class_;
|
||||||
case BL_NPC: return ((TBL_NPC*)bl)->class_;
|
case BL_NPC: return ((TBL_NPC*)bl)->class_;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -6783,6 +6784,26 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid)
|
|||||||
if (calc_flag)
|
if (calc_flag)
|
||||||
status_calc_bl(bl,calc_flag);
|
status_calc_bl(bl,calc_flag);
|
||||||
|
|
||||||
|
if( bl->type == BL_MER )
|
||||||
|
switch( type )
|
||||||
|
{ // Update Status Window
|
||||||
|
case SC_MERC_HPUP:
|
||||||
|
clif_mercenary_updatestatus(((TBL_MER*)bl)->master, SP_MAXHP);
|
||||||
|
break;
|
||||||
|
case SC_MERC_SPUP:
|
||||||
|
clif_mercenary_updatestatus(((TBL_MER*)bl)->master, SP_MAXSP);
|
||||||
|
break;
|
||||||
|
case SC_MERC_FLEEUP:
|
||||||
|
clif_mercenary_updatestatus(((TBL_MER*)bl)->master, SP_MERCFLEE);
|
||||||
|
break;
|
||||||
|
case SC_MERC_ATKUP:
|
||||||
|
clif_mercenary_updatestatus(((TBL_MER*)bl)->master, SP_ATK1);
|
||||||
|
break;
|
||||||
|
case SC_MERC_HITUP:
|
||||||
|
clif_mercenary_updatestatus(((TBL_MER*)bl)->master, SP_HIT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(opt_flag&4) //Out of hiding, invoke on place.
|
if(opt_flag&4) //Out of hiding, invoke on place.
|
||||||
skill_unit_move(bl,gettick(),1);
|
skill_unit_move(bl,gettick(),1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user