* Implemented more official Warp Portal behavior

- the transition from active to waiting mode is now done as a simple appearance change instead of deleting one and creating the other
- due to the above, an opening warp is now properly accompanied by the log-in like sound effect

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11404 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2007-10-10 23:47:02 +00:00
parent d5ce8d6042
commit 03afc4ffda
3 changed files with 30 additions and 22 deletions

View File

@ -7,6 +7,11 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
* Fixed itemdb_read_sqldb blowing up the server with segmentation faults. * Fixed itemdb_read_sqldb blowing up the server with segmentation faults.
* Added an option for parse_script to ignore the checks for the set of * Added an option for parse_script to ignore the checks for the set of
brackets around the script. [FlavioJS] brackets around the script. [FlavioJS]
* Implemented more official Warp Portal behavior
- the transition from active to waiting mode is now done as a simple
appearance change instead of deleting one and creating the other
- due to the above, an opening warp is now properly accompanied by
the log-in like sound effect
* Re-enabled packet 0x1ac to be sent when something gets ankle-snared * Re-enabled packet 0x1ac to be sent when something gets ankle-snared
* Partially removed the usage of 'flags' to direct the execution path * Partially removed the usage of 'flags' to direct the execution path
in skill unit code (some people seem to really like flags >_>) in skill unit code (some people seem to really like flags >_>)

View File

@ -2632,17 +2632,19 @@ int clif_changestatus(struct block_list *bl,int type,int val)
/*========================================== /*==========================================
* *
*------------------------------------------*/ *------------------------------------------*/
int clif_changelook(struct block_list *bl,int type,int val) void clif_changelook(struct block_list *bl,int type,int val)
{ {
unsigned char buf[32]; unsigned char buf[16];
struct map_session_data *sd = NULL; struct map_session_data* sd = NULL;
struct view_data *vd; struct view_data* vd;
vd = status_get_viewdata(bl); nullpo_retv(bl);
nullpo_retr(0, vd);
BL_CAST(BL_PC, bl, sd); BL_CAST(BL_PC, bl, sd);
vd = status_get_viewdata(bl);
switch(type) { //nullpo_ret(vd);
if( vd ) //temp hack to let Warp Portal change appearance
switch(type)
{
case LOOK_WEAPON: case LOOK_WEAPON:
if (sd) if (sd)
{ {
@ -2710,6 +2712,7 @@ int clif_changelook(struct block_list *bl,int type,int val)
//Shoes? No packet uses this.... //Shoes? No packet uses this....
break; break;
} }
#if PACKETVER < 4 #if PACKETVER < 4
WBUFW(buf,0)=0xc3; WBUFW(buf,0)=0xc3;
WBUFL(buf,2)=bl->id; WBUFL(buf,2)=bl->id;
@ -2717,25 +2720,19 @@ int clif_changelook(struct block_list *bl,int type,int val)
WBUFB(buf,7)=val; WBUFB(buf,7)=val;
clif_send(buf,packet_len(0xc3),bl,AREA); clif_send(buf,packet_len(0xc3),bl,AREA);
#else #else
WBUFW(buf,0)=0x1d7;
WBUFL(buf,2)=bl->id;
if(type == LOOK_WEAPON || type == LOOK_SHIELD) { if(type == LOOK_WEAPON || type == LOOK_SHIELD) {
WBUFW(buf,0)=0x1d7;
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=LOOK_WEAPON; WBUFB(buf,6)=LOOK_WEAPON;
WBUFW(buf,7)=vd->weapon; WBUFW(buf,7)=vd->weapon;
WBUFW(buf,9)=vd->shield; WBUFW(buf,9)=vd->shield;
clif_send(buf,packet_len(0x1d7),bl,AREA); } else {
}
else
{
WBUFW(buf,0)=0x1d7;
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=type; WBUFB(buf,6)=type;
WBUFW(buf,7)=val; WBUFW(buf,7)=val;
WBUFW(buf,9)=0; WBUFW(buf,9)=0;
clif_send(buf,packet_len(0x1d7),bl,AREA);
} }
clif_send(buf,packet_len(0x1d7),bl,AREA);
#endif #endif
return 0;
} }
//Sends a change-base-look packet required for traps as they are triggered. //Sends a change-base-look packet required for traps as they are triggered.

View File

@ -7041,9 +7041,9 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid,
group->limit = unit->limit; group->limit = unit->limit;
} }
// execute on all targets standing on this cell
if (range==0 && active_flag) if (range==0 && active_flag)
map_foreachincell(skill_unit_effect,unit->bl.m, map_foreachincell(skill_unit_effect,unit->bl.m, unit->bl.x,unit->bl.y,group->bl_flag,&unit->bl,gettick(),1);
unit->bl.x,unit->bl.y,group->bl_flag,&unit->bl,gettick(),1);
} }
} }
@ -10262,8 +10262,14 @@ int skill_unit_timer_sub (struct block_list* bl, va_list ap)
break; break;
case UNT_WARP_ACTIVE: case UNT_WARP_ACTIVE:
skill_unitsetting(&unit->bl,group->skill_id,group->skill_lv,unit->bl.x,unit->bl.y,1); // warp portal opens (morph to a UNT_WARP_WAITING cell)
skill_delunit(unit); group->unit_id = UNT_WARP_WAITING;
clif_changelook(&unit->bl, LOOK_BASE, group->unit_id);
// restart timers
group->limit = skill_get_time(group->skill_id,group->skill_lv);
unit->limit = skill_get_time(group->skill_id,group->skill_lv);
// apply effect to all units standing on it
map_foreachincell(skill_unit_effect,unit->bl.m,unit->bl.x,unit->bl.y,group->bl_flag,&unit->bl,gettick(),1);
break; break;
case UNT_CALLFAMILY: case UNT_CALLFAMILY: