Skip to content

Commit

Permalink
Follow: 8ab6174
Browse files Browse the repository at this point in the history
This fixed all mob size problem :)
Fix estin estun not working properly (bug:7891)
  • Loading branch information
Michieru committed Sep 16, 2014
1 parent 8ab6174 commit ddc5257
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions db/const.txt
Expand Up @@ -679,8 +679,8 @@ RC2_Golem 4
RC2_Guardian 5
RC2_Ninja 6

Size_Medium 0
Size_Small 1
Size_Small 0
Size_Medium 1
Size_Large 2

BF_WEAPON 0x0001
Expand Down
18 changes: 9 additions & 9 deletions src/map/atcommand.c
Expand Up @@ -6252,7 +6252,7 @@ ACMD(summon)
return false;
}

md = mob->once_spawn_sub(&sd->bl, sd->bl.m, -1, -1, "--ja--", mob_id, "", SZ_MEDIUM, AI_NONE);
md = mob->once_spawn_sub(&sd->bl, sd->bl.m, -1, -1, "--ja--", mob_id, "", SZ_SMALL, AI_NONE);

if(!md)
return false;
Expand Down Expand Up @@ -7312,15 +7312,15 @@ ACMD(size)
{
int size = 0;

size = cap_value(atoi(message),SZ_MEDIUM,SZ_BIG);
size = cap_value(atoi(message),SZ_SMALL,SZ_BIG);

if(sd->state.size) {
sd->state.size = SZ_MEDIUM;
sd->state.size = SZ_SMALL;
pc->setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT);
}

sd->state.size = size;
if( size == SZ_SMALL )
if( size == SZ_MEDIUM )
clif->specialeffect(&sd->bl,420,AREA);
else if( size == SZ_BIG )
clif->specialeffect(&sd->bl,422,AREA);
Expand All @@ -7342,12 +7342,12 @@ ACMD(sizeall)
for( pl_sd = (TBL_PC*)mapit->first(iter); mapit->exists(iter); pl_sd = (TBL_PC*)mapit->next(iter) ) {
if( pl_sd->state.size != size ) {
if( pl_sd->state.size ) {
pl_sd->state.size = SZ_MEDIUM;
pl_sd->state.size = SZ_SMALL;
pc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}

pl_sd->state.size = size;
if( size == SZ_SMALL )
if( size == SZ_MEDIUM )
clif->specialeffect(&pl_sd->bl,420,AREA);
else if( size == SZ_BIG )
clif->specialeffect(&pl_sd->bl,422,AREA);
Expand Down Expand Up @@ -7378,17 +7378,17 @@ ACMD(sizeguild)
return false;
}

size = cap_value(size,SZ_MEDIUM,SZ_BIG);
size = cap_value(size,SZ_SMALL,SZ_BIG);

for( i = 0; i < g->max_member; i++ ) {
if( (pl_sd = g->member[i].sd) && pl_sd->state.size != size ) {
if( pl_sd->state.size ) {
pl_sd->state.size = SZ_MEDIUM;
pl_sd->state.size = SZ_SMALL;
pc->setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT);
}

pl_sd->state.size = size;
if( size == SZ_SMALL )
if( size == SZ_MEDIUM )
clif->specialeffect(&pl_sd->bl,420,AREA);
else if( size == SZ_BIG )
clif->specialeffect(&pl_sd->bl,422,AREA);
Expand Down
14 changes: 7 additions & 7 deletions src/map/clif.c
Expand Up @@ -1348,7 +1348,7 @@ bool clif_spawn(struct block_list *bl)
clif->spiritball(&sd->bl);
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
clif->specialeffect(bl,423,AREA);
else if(sd->state.size==SZ_SMALL)
else if(sd->state.size==SZ_MEDIUM)
clif->specialeffect(bl,421,AREA);
if( sd->bg_id && map->list[sd->bl.m].flag.battleground )
clif->sendbgemblem_area(sd);
Expand Down Expand Up @@ -1377,7 +1377,7 @@ bool clif_spawn(struct block_list *bl)
TBL_NPC *nd = ((TBL_NPC*)bl);
if( nd->size == SZ_BIG )
clif->specialeffect(&nd->bl,423,AREA);
else if( nd->size == SZ_SMALL )
else if( nd->size == SZ_MEDIUM )
clif->specialeffect(&nd->bl,421,AREA);
}
break;
Expand Down Expand Up @@ -1585,7 +1585,7 @@ void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *u
// clif_movepc(sd);
if(sd->state.size==SZ_BIG) // tiny/big players [Valaris]
clif->specialeffect(&sd->bl,423,AREA);
else if(sd->state.size==SZ_SMALL)
else if(sd->state.size==SZ_MEDIUM)
clif->specialeffect(&sd->bl,421,AREA);
}
break;
Expand All @@ -1594,7 +1594,7 @@ void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *u
TBL_MOB *md = ((TBL_MOB*)bl);
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
clif->specialeffect(&md->bl,423,AREA);
else if(md->special_state.size==SZ_SMALL)
else if(md->special_state.size==SZ_MEDIUM)
clif->specialeffect(&md->bl,421,AREA);
}
break;
Expand Down Expand Up @@ -4326,7 +4326,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
clif->getareachar_pc(sd, tsd);
if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris]
clif->specialeffect_single(bl,423,sd->fd);
else if(tsd->state.size==SZ_SMALL)
else if(tsd->state.size==SZ_MEDIUM)
clif->specialeffect_single(bl,421,sd->fd);
if( tsd->bg_id && map->list[tsd->bl.m].flag.battleground )
clif->sendbgemblem_single(sd->fd,tsd);
Expand All @@ -4345,7 +4345,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
clif->dispchat((struct chat_data*)map->id2bl(nd->chat_id),sd->fd);
if( nd->size == SZ_BIG )
clif->specialeffect_single(bl,423,sd->fd);
else if( nd->size == SZ_SMALL )
else if( nd->size == SZ_MEDIUM )
clif->specialeffect_single(bl,421,sd->fd);
}
break;
Expand All @@ -4354,7 +4354,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) {
TBL_MOB* md = (TBL_MOB*)bl;
if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris]
clif->specialeffect_single(bl,423,sd->fd);
else if(md->special_state.size==SZ_SMALL)
else if(md->special_state.size==SZ_MEDIUM)
clif->specialeffect_single(bl,421,sd->fd);
#if PACKETVER >= 20120404
if( !(md->status.mode&MD_BOSS) ){
Expand Down
6 changes: 3 additions & 3 deletions src/map/mob.c
Expand Up @@ -2203,7 +2203,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
// change experience for different sized monsters [Valaris]
if (battle_config.mob_size_influence) {
switch( md->special_state.size ) {
case SZ_SMALL:
case SZ_MEDIUM:
per /= 2.;
break;
case SZ_BIG:
Expand Down Expand Up @@ -2324,7 +2324,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
// change drops depending on monsters size [Valaris]
if (battle_config.mob_size_influence)
{
if (md->special_state.size == SZ_SMALL && drop_rate >= 2)
if (md->special_state.size == SZ_MEDIUM && drop_rate >= 2)
drop_rate /= 2;
else if( md->special_state.size == SZ_BIG)
drop_rate *= 2;
Expand Down Expand Up @@ -3508,7 +3508,7 @@ int mob_clone_spawn(struct map_session_data *sd, int16 m, int16 x, int16 y, cons
sd->fd = fd;

//Finally, spawn it.
md = mob->once_spawn_sub(&sd->bl, m, x, y, "--en--", class_, event, SZ_MEDIUM, AI_NONE);
md = mob->once_spawn_sub(&sd->bl, m, x, y, "--en--", class_, event, SZ_SMALL, AI_NONE);
if (!md) return 0; //Failed?

md->special_state.clone = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/map/mob.h
Expand Up @@ -62,8 +62,8 @@ enum MobDamageLogFlag
};

enum size {
SZ_MEDIUM = 0,
SZ_SMALL,
SZ_SMALL = 0,
SZ_MEDIUM,
SZ_BIG,
};

Expand Down
6 changes: 3 additions & 3 deletions src/map/script.c
Expand Up @@ -9072,7 +9072,7 @@ BUILDIN(monster)
int class_ = script_getnum(st,6);
int amount = script_getnum(st,7);
const char *event = "";
unsigned int size = SZ_MEDIUM;
unsigned int size = SZ_SMALL;
unsigned int ai = AI_NONE;
int mob_id;

Expand Down Expand Up @@ -9181,7 +9181,7 @@ BUILDIN(areamonster) {
int class_ = script_getnum(st,8);
int amount = script_getnum(st,9);
const char *event = "";
unsigned int size = SZ_MEDIUM;
unsigned int size = SZ_SMALL;
unsigned int ai = AI_NONE;
int mob_id;

Expand Down Expand Up @@ -13501,7 +13501,7 @@ BUILDIN(summon)

clif->skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick);

md = mob->once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, class_, event, SZ_MEDIUM, AI_NONE);
md = mob->once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, class_, event, SZ_SMALL, AI_NONE);
if (md) {
md->master_id=sd->bl.id;
md->special_state.ai = AI_ATTACK;
Expand Down
14 changes: 7 additions & 7 deletions src/map/skill.c
Expand Up @@ -5459,7 +5459,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
case SA_SUMMONMONSTER:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
if (sd) mob->once_spawn(sd, src->m, src->x, src->y," --ja--", -1, 1, "", SZ_MEDIUM, AI_NONE);
if (sd) mob->once_spawn(sd, src->m, src->x, src->y," --ja--", -1, 1, "", SZ_SMALL, AI_NONE);
break;
case SA_LEVELUP:
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
Expand Down Expand Up @@ -9430,7 +9430,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if(sd) {
struct mob_data *summon_md;

summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), 2308, "", SZ_MEDIUM, AI_NONE);
summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), 2308, "", SZ_SMALL, AI_NONE);
if( summon_md ) {
summon_md->master_id = src->id;
summon_md->special_state.ai = AI_ZANZOU;
Expand Down Expand Up @@ -9604,7 +9604,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;

for(i=0; i<qty[skill_lv - 1]; i++){ //easy way
summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), summons[skill_lv - 1], "", SZ_MEDIUM, AI_ATTACK);
summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), summons[skill_lv - 1], "", SZ_SMALL, AI_ATTACK);
if (summon_md) {
summon_md->master_id = src->id;
if (summon_md->deletetimer != INVALID_TIMER)
Expand Down Expand Up @@ -10288,7 +10288,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
struct mob_data *md;

// Correct info, don't change any of this! [Celest]
md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_MEDIUM, AI_NONE);
md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_SMALL, AI_NONE);
if (md) {
md->master_id = src->id;
md->special_state.ai = (skill_id == AM_SPHEREMINE) ? AI_SPHERE : AI_FLORA;
Expand Down Expand Up @@ -10386,7 +10386,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
if (rnd()%100 < 50) {
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
} else {
TBL_MOB* md = mob->once_spawn_sub(src, src->m, x, y, "--ja--",(skill_lv < 2 ? 1084+rnd()%2 : 1078+rnd()%6),"", SZ_MEDIUM, AI_NONE);
TBL_MOB* md = mob->once_spawn_sub(src, src->m, x, y, "--ja--",(skill_lv < 2 ? 1084+rnd()%2 : 1078+rnd()%6),"", SZ_SMALL, AI_NONE);
int i;
if (!md) break;
if ((i = skill->get_time(skill_id, skill_lv)) > 0)
Expand Down Expand Up @@ -10533,7 +10533,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
int class_ = 2042;
struct mob_data *md;

md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_MEDIUM, AI_NONE);
md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_SMALL, AI_NONE);
if( md ) {
md->master_id = src->id;
md->special_state.ai = AI_FLORA;
Expand Down Expand Up @@ -17193,7 +17193,7 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) {
class_ = (nameid == ITEMID_BOODY_RED || nameid == ITEMID_CRYSTAL_BLUE) ? 2043 + nameid - ITEMID_BOODY_RED : (nameid == ITEMID_WIND_OF_VERDURE) ? 2046 : 2045;


md = mob->once_spawn_sub(&sd->bl, sd->bl.m, x, y, sd->status.name, class_, "", SZ_MEDIUM, AI_NONE);
md = mob->once_spawn_sub(&sd->bl, sd->bl.m, x, y, sd->status.name, class_, "", SZ_SMALL, AI_NONE);
if( md ) {
md->master_id = sd->bl.id;
md->special_state.ai = AI_FLORA;
Expand Down
2 changes: 1 addition & 1 deletion src/map/status.c
Expand Up @@ -2164,7 +2164,7 @@ int status_calc_mob_(struct mob_data* md, enum e_status_calc_opt opt) {

if (flag&2 && battle_config.mob_size_influence) {
// change for sized monsters [Valaris]
if (md->special_state.size==SZ_SMALL) {
if (md->special_state.size==SZ_MEDIUM) {
mstatus->max_hp>>=1;
mstatus->max_sp>>=1;
if (!mstatus->max_hp) mstatus->max_hp = 1;
Expand Down

0 comments on commit ddc5257

Please sign in to comment.