diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-01 02:23:56 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-04-01 02:23:56 +0000 |
commit | 53796ffafd6eb381595b77cda1b039d795940e68 (patch) | |
tree | a33bec85a09564086f6b356a9e6d0e0797e9b079 /src/map/script.c | |
parent | 454ae6b78937da966545207b94b1e0a037fdb098 (diff) | |
download | hercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.gz hercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.bz2 hercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.xz hercules-53796ffafd6eb381595b77cda1b039d795940e68.zip |
- Added structure view_data to handle sprite information for all characters (equipment, weapons, hair, dyes, etc). Unified a bunch of clif functions now that you only need to handle the view_data (so instead of clif_spawn[pc/mob/npc/pet] you just have clif_spawn)
- Fixed the clif_change_class packet (it should check for non players classes, not a class above MAX_PC_CLASS), it fixes morphing enemies.
- Rewrote the way cloth dye packets are resent to optimize bandwidth usage.
- Fixed the npc_item_flag thing (enable_items/disable_items script command)
- Rewrote the disguise implementation to be bandwidth friendly.
- Modified the hide options to change your class to INVISIBLE_CLASS, since such classes don't even get their view packets sent around.
- Rewrote several clif functions to adapt to the new view_data class;
- Added class 139 to npcdb_checkid which was required by some npcs in the swordman quest? o.O
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5833 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/src/map/script.c b/src/map/script.c index 8e09ad061..c9dfb3cd8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6333,11 +6333,9 @@ int buildin_changebase(struct script_state *st) return 0;
}
-// if(vclass==22) {
-// pc_unequipitem(sd,sd->equip_index[9],0); // ‘•”õŠO
-// }
-
- sd->view_class = vclass;
+ //If you are already using a special view (disguises?) prevent overriding it. [Skotlex]
+ if (sd->vd.class_ == sd->status.class_)
+ status_set_viewdata(&sd->bl, vclass);
return 0;
}
@@ -8054,13 +8052,7 @@ int buildin_disguise(struct script_state *st) return 0;
}
- pc_stop_walking(sd,0);
- clif_clearchar(&sd->bl, 0);
- sd->disguise = id;
- sd->state.disguised = 1; // set to override items with disguise script [Valaris]
- clif_changeoption(&sd->bl);
- clif_spawnpc(sd);
-
+ pc_disguise(sd, id);
push_val(st->stack,C_INT,id);
return 0;
}
@@ -8074,11 +8066,7 @@ int buildin_undisguise(struct script_state *st) struct map_session_data *sd=script_rid2sd(st);
if (sd->disguise) {
- pc_stop_walking(sd,0);
- clif_clearchar(&sd->bl, 0);
- sd->disguise = 0;
- clif_changeoption(&sd->bl);
- clif_spawnpc(sd);
+ pc_disguise(sd, 0);
push_val(st->stack,C_INT,0);
} else {
push_val(st->stack,C_INT,1);
@@ -10209,17 +10197,17 @@ int buildin_getmobdata(struct script_state *st) { setd_sub(map_id2sd(st->rid),name,9,(void *)(int)md->mode);
setd_sub(map_id2sd(st->rid),name,10,(void *)(int)md->special_state.ai);
setd_sub(map_id2sd(st->rid),name,11,(void *)(int)md->db->option);
- setd_sub(map_id2sd(st->rid),name,12,(void *)(int)md->db->sex);
- setd_sub(map_id2sd(st->rid),name,13,(void *)(int)md->db->view_class);
- setd_sub(map_id2sd(st->rid),name,14,(void *)(int)md->db->hair);
- setd_sub(map_id2sd(st->rid),name,15,(void *)(int)md->db->hair_color);
- setd_sub(map_id2sd(st->rid),name,16,(void *)(int)md->db->head_buttom);
- setd_sub(map_id2sd(st->rid),name,17,(void *)(int)md->db->head_mid);
- setd_sub(map_id2sd(st->rid),name,18,(void *)(int)md->db->head_top);
- setd_sub(map_id2sd(st->rid),name,19,(void *)(int)md->db->clothes_color);
- setd_sub(map_id2sd(st->rid),name,20,(void *)(int)md->db->equip);
- setd_sub(map_id2sd(st->rid),name,21,(void *)(int)md->db->weapon);
- setd_sub(map_id2sd(st->rid),name,22,(void *)(int)md->db->shield);
+ setd_sub(map_id2sd(st->rid),name,12,(void *)(int)md->vd->sex);
+ setd_sub(map_id2sd(st->rid),name,13,(void *)(int)md->vd->class_);
+ setd_sub(map_id2sd(st->rid),name,14,(void *)(int)md->vd->hair_style);
+ setd_sub(map_id2sd(st->rid),name,15,(void *)(int)md->vd->hair_color);
+ setd_sub(map_id2sd(st->rid),name,16,(void *)(int)md->vd->head_bottom);
+ setd_sub(map_id2sd(st->rid),name,17,(void *)(int)md->vd->head_mid);
+ setd_sub(map_id2sd(st->rid),name,18,(void *)(int)md->vd->head_top);
+ setd_sub(map_id2sd(st->rid),name,19,(void *)(int)md->vd->cloth_color);
+ setd_sub(map_id2sd(st->rid),name,20,(void *)(int)md->vd->shield);
+ setd_sub(map_id2sd(st->rid),name,21,(void *)(int)md->vd->weapon);
+ setd_sub(map_id2sd(st->rid),name,22,(void *)(int)md->vd->shield);
setd_sub(map_id2sd(st->rid),name,23,(void *)(int)md->ud.dir);
}
return 0;
@@ -10271,37 +10259,37 @@ int buildin_setmobdata(struct script_state *st){ md->db->option = (short)value;
break;
case 12:
- md->db->sex = value;
+ md->vd->sex = value;
break;
case 13:
- md->db->view_class = value;
+ md->vd->class_ = value;
break;
case 14:
- md->db->hair = (short)value;
+ md->vd->hair_style = (short)value;
break;
case 15:
- md->db->hair_color = (short)value;
+ md->vd->hair_color = (short)value;
break;
case 16:
- md->db->head_buttom = (short)value;
+ md->vd->head_bottom = (short)value;
break;
case 17:
- md->db->head_mid = (short)value;
+ md->vd->head_mid = (short)value;
break;
case 18:
- md->db->head_top = (short)value;
+ md->vd->head_top = (short)value;
break;
case 19:
- md->db->clothes_color = (short)value;
+ md->vd->cloth_color = (short)value;
break;
case 20:
- md->db->equip = value;
+ md->vd->shield = value;
break;
case 21:
- md->db->weapon = (short)value;
+ md->vd->weapon = (short)value;
break;
case 22:
- md->db->shield = (short)value;
+ md->vd->shield = (short)value;
break;
case 23:
md->ud.dir = (unsigned char)value;
|