[Optimized]:
- clif_specialeffect to use the enums. [Improved]: - buildin_specialeffect and buildin_specialeffect2 to accept effect area definition. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6855 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
40f2aa9cc5
commit
e266a08f7c
@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
|
|||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
|
|
||||||
2006/05/30
|
2006/05/30
|
||||||
|
* [Optimized]:
|
||||||
|
- clif_specialeffect to use the enums.
|
||||||
|
[Improved]:
|
||||||
|
- buildin_specialeffect and buildin_specialeffect2 to accept effect area
|
||||||
|
definition. [Lance]
|
||||||
* [Added]:
|
* [Added]:
|
||||||
- Visual Studio .NET 2003 includes for mercenary.c [Lance]
|
- Visual Studio .NET 2003 includes for mercenary.c [Lance]
|
||||||
* Removed the on-die specific code from unit_remove_map and placed it on
|
* Removed the on-die specific code from unit_remove_map and placed it on
|
||||||
|
@ -2378,7 +2378,7 @@ int atcommand_die(
|
|||||||
const char* command, const char* message)
|
const char* command, const char* message)
|
||||||
{
|
{
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
clif_specialeffect(&sd->bl,450,1);
|
clif_specialeffect(&sd->bl,450,SELF);
|
||||||
status_kill(&sd->bl);
|
status_kill(&sd->bl);
|
||||||
clif_displaymessage(fd, msg_table[13]); // A pity! You've died.
|
clif_displaymessage(fd, msg_table[13]); // A pity! You've died.
|
||||||
|
|
||||||
@ -4827,7 +4827,7 @@ int atcommand_doom(
|
|||||||
struct map_session_data *pl_sd, **pl_allsd;
|
struct map_session_data *pl_sd, **pl_allsd;
|
||||||
int i, users;
|
int i, users;
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
clif_specialeffect(&sd->bl,450,2);
|
clif_specialeffect(&sd->bl,450,ALL_SAMEMAP);
|
||||||
pl_allsd = map_getallusers(&users);
|
pl_allsd = map_getallusers(&users);
|
||||||
for(i = 0; i < users; i++) {
|
for(i = 0; i < users; i++) {
|
||||||
if ((pl_sd = pl_allsd[i]) && pl_sd->fd != fd && pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
|
if ((pl_sd = pl_allsd[i]) && pl_sd->fd != fd && pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
|
||||||
@ -4851,7 +4851,7 @@ int atcommand_doommap(
|
|||||||
struct map_session_data *pl_sd, **pl_allsd;
|
struct map_session_data *pl_sd, **pl_allsd;
|
||||||
int i, users;
|
int i, users;
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
clif_specialeffect(&sd->bl,450,3);
|
clif_specialeffect(&sd->bl,450,ALL_CLIENT);
|
||||||
pl_allsd = map_getallusers(&users);
|
pl_allsd = map_getallusers(&users);
|
||||||
for (i = 0; i < users; i++) {
|
for (i = 0; i < users; i++) {
|
||||||
if ((pl_sd = pl_allsd[i]) && pl_sd->fd != fd && sd->bl.m == pl_sd->bl.m &&
|
if ((pl_sd = pl_allsd[i]) && pl_sd->fd != fd && sd->bl.m == pl_sd->bl.m &&
|
||||||
@ -6808,27 +6808,16 @@ int atcommand_effect(
|
|||||||
const int fd, struct map_session_data* sd,
|
const int fd, struct map_session_data* sd,
|
||||||
const char* command, const char* message)
|
const char* command, const char* message)
|
||||||
{
|
{
|
||||||
struct map_session_data *pl_sd, **pl_allsd;
|
int type = 0, flag = 0;
|
||||||
int type = 0, flag = 0, i, users;
|
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
|
|
||||||
if (!message || !*message || sscanf(message, "%d %d", &type,&flag) < 2) {
|
if (!message || !*message || sscanf(message, "%d %d", &type,&flag) < 2) {
|
||||||
clif_displaymessage(fd, "Please, enter at least a option (usage: @effect <type+>).");
|
clif_displaymessage(fd, "Please, enter at least a option (usage: @effect <type+>).");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(flag <=0){
|
|
||||||
clif_specialeffect(&sd->bl, type, flag);
|
clif_specialeffect(&sd->bl, type, flag);
|
||||||
clif_displaymessage(fd, msg_table[229]); // Your effect has changed.
|
clif_displaymessage(fd, msg_table[229]); // Your effect has changed.
|
||||||
}
|
|
||||||
else{
|
|
||||||
pl_allsd = map_getallusers(&users);
|
|
||||||
for (i = 0; i < users; i++) {
|
|
||||||
if ((pl_sd = pl_allsd[i])) {
|
|
||||||
clif_specialeffect(&pl_sd->bl, type, flag);
|
|
||||||
clif_displaymessage(pl_sd->fd, msg_table[229]); // Your effect has changed.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -9796,10 +9785,10 @@ int atcommand_size(
|
|||||||
|
|
||||||
if(size==1) {
|
if(size==1) {
|
||||||
sd->state.size=1;
|
sd->state.size=1;
|
||||||
clif_specialeffect(&sd->bl,420,0);
|
clif_specialeffect(&sd->bl,420,AREA);
|
||||||
} else if(size==2) {
|
} else if(size==2) {
|
||||||
sd->state.size=2;
|
sd->state.size=2;
|
||||||
clif_specialeffect(&sd->bl,422,0);
|
clif_specialeffect(&sd->bl,422,AREA);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -890,7 +890,7 @@ charcommand_effect(const int fd, struct map_session_data* sd,
|
|||||||
if((pl_sd=map_nick2sd((char *) target)) == NULL)
|
if((pl_sd=map_nick2sd((char *) target)) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
clif_specialeffect(&pl_sd->bl, type, 0);
|
clif_specialeffect(&pl_sd->bl, type, AREA);
|
||||||
clif_displaymessage(fd, msg_table[229]); // Your effect has changed.
|
clif_displaymessage(fd, msg_table[229]); // Your effect has changed.
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -120,33 +120,6 @@ static const int packet_len_table[MAX_PACKET_DB] = {
|
|||||||
3, 32, -1, 3, 3, 5, 5, 8, 2, 3, -1, -1, 4,-1, 4
|
3, 32, -1, 3, 3, 5, 5, 8, 2, 3, -1, -1, 4,-1, 4
|
||||||
};
|
};
|
||||||
|
|
||||||
// local define
|
|
||||||
enum {
|
|
||||||
ALL_CLIENT,
|
|
||||||
ALL_SAMEMAP,
|
|
||||||
AREA,
|
|
||||||
AREA_WOS,
|
|
||||||
AREA_WOC,
|
|
||||||
AREA_WOSC,
|
|
||||||
AREA_CHAT_WOC,
|
|
||||||
CHAT,
|
|
||||||
CHAT_WOS,
|
|
||||||
CHAT_MAINCHAT,
|
|
||||||
PARTY,
|
|
||||||
PARTY_WOS,
|
|
||||||
PARTY_SAMEMAP,
|
|
||||||
PARTY_SAMEMAP_WOS,
|
|
||||||
PARTY_AREA,
|
|
||||||
PARTY_AREA_WOS,
|
|
||||||
GUILD,
|
|
||||||
GUILD_WOS,
|
|
||||||
GUILD_SAMEMAP, // [Valaris]
|
|
||||||
GUILD_SAMEMAP_WOS,
|
|
||||||
GUILD_AREA,
|
|
||||||
GUILD_AREA_WOS, // end additions [Valaris]
|
|
||||||
SELF
|
|
||||||
};
|
|
||||||
|
|
||||||
//Converts item type in case of pet eggs.
|
//Converts item type in case of pet eggs.
|
||||||
#define itemtype(a) (a == 7)?4:a
|
#define itemtype(a) (a == 7)?4:a
|
||||||
|
|
||||||
@ -1347,18 +1320,18 @@ int clif_spawn(struct block_list *bl)
|
|||||||
if (sd->spiritball > 0)
|
if (sd->spiritball > 0)
|
||||||
clif_spiritball(sd);
|
clif_spiritball(sd);
|
||||||
if(sd->state.size==2) // tiny/big players [Valaris]
|
if(sd->state.size==2) // tiny/big players [Valaris]
|
||||||
clif_specialeffect(bl,423,0);
|
clif_specialeffect(bl,423,AREA);
|
||||||
else if(sd->state.size==1)
|
else if(sd->state.size==1)
|
||||||
clif_specialeffect(bl,421,0);
|
clif_specialeffect(bl,421,AREA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BL_MOB:
|
case BL_MOB:
|
||||||
{
|
{
|
||||||
TBL_MOB *md = ((TBL_MOB*)bl);
|
TBL_MOB *md = ((TBL_MOB*)bl);
|
||||||
if(md->special_state.size==2) // tiny/big mobs [Valaris]
|
if(md->special_state.size==2) // tiny/big mobs [Valaris]
|
||||||
clif_specialeffect(&md->bl,423,0);
|
clif_specialeffect(&md->bl,423,AREA);
|
||||||
else if(md->special_state.size==1)
|
else if(md->special_state.size==1)
|
||||||
clif_specialeffect(&md->bl,421,0);
|
clif_specialeffect(&md->bl,421,AREA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1599,18 +1572,18 @@ int clif_move(struct block_list *bl) {
|
|||||||
TBL_PC *sd = ((TBL_PC*)bl);
|
TBL_PC *sd = ((TBL_PC*)bl);
|
||||||
// clif_movepc(sd);
|
// clif_movepc(sd);
|
||||||
if(sd->state.size==2) // tiny/big players [Valaris]
|
if(sd->state.size==2) // tiny/big players [Valaris]
|
||||||
clif_specialeffect(&sd->bl,423,0);
|
clif_specialeffect(&sd->bl,423,AREA);
|
||||||
else if(sd->state.size==1)
|
else if(sd->state.size==1)
|
||||||
clif_specialeffect(&sd->bl,421,0);
|
clif_specialeffect(&sd->bl,421,AREA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BL_MOB:
|
case BL_MOB:
|
||||||
{
|
{
|
||||||
TBL_MOB *md = ((TBL_MOB*)bl);
|
TBL_MOB *md = ((TBL_MOB*)bl);
|
||||||
if(md->special_state.size==2) // tiny/big mobs [Valaris]
|
if(md->special_state.size==2) // tiny/big mobs [Valaris]
|
||||||
clif_specialeffect(&md->bl,423,0);
|
clif_specialeffect(&md->bl,423,AREA);
|
||||||
else if(md->special_state.size==1)
|
else if(md->special_state.size==1)
|
||||||
clif_specialeffect(&md->bl,421,0);
|
clif_specialeffect(&md->bl,421,AREA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3864,9 +3837,9 @@ void clif_getareachar_char(struct map_session_data* sd,struct block_list *bl)
|
|||||||
TBL_PC* tsd = (TBL_PC*)bl;
|
TBL_PC* tsd = (TBL_PC*)bl;
|
||||||
clif_getareachar_pc(sd, tsd);
|
clif_getareachar_pc(sd, tsd);
|
||||||
if(tsd->state.size==2) // tiny/big players [Valaris]
|
if(tsd->state.size==2) // tiny/big players [Valaris]
|
||||||
clif_specialeffect(bl,423,0);
|
clif_specialeffect(bl,423,AREA);
|
||||||
else if(tsd->state.size==1)
|
else if(tsd->state.size==1)
|
||||||
clif_specialeffect(bl,421,0);
|
clif_specialeffect(bl,421,AREA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BL_NPC:
|
case BL_NPC:
|
||||||
@ -3879,9 +3852,9 @@ void clif_getareachar_char(struct map_session_data* sd,struct block_list *bl)
|
|||||||
{
|
{
|
||||||
TBL_MOB* md = (TBL_MOB*)bl;
|
TBL_MOB* md = (TBL_MOB*)bl;
|
||||||
if(md->special_state.size==2) // tiny/big mobs [Valaris]
|
if(md->special_state.size==2) // tiny/big mobs [Valaris]
|
||||||
clif_specialeffect(bl,423,0);
|
clif_specialeffect(bl,423,AREA);
|
||||||
else if(md->special_state.size==1)
|
else if(md->special_state.size==1)
|
||||||
clif_specialeffect(bl,421,0);
|
clif_specialeffect(bl,421,AREA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -7753,22 +7726,8 @@ int clif_specialeffect(struct block_list *bl, int type, int flag)
|
|||||||
WBUFL(buf,2) = bl->id;
|
WBUFL(buf,2) = bl->id;
|
||||||
WBUFL(buf,6) = type;
|
WBUFL(buf,6) = type;
|
||||||
|
|
||||||
switch (flag) {
|
clif_send(buf, packet_len_table[0x1f3], bl, flag);
|
||||||
case 4:
|
|
||||||
clif_send(buf, packet_len_table[0x1f3], bl, AREA_WOS);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
clif_send(buf, packet_len_table[0x1f3], bl, ALL_CLIENT);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
clif_send(buf, packet_len_table[0x1f3], bl, ALL_SAMEMAP);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
clif_send(buf, packet_len_table[0x1f3], bl, SELF);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
clif_send(buf, packet_len_table[0x1f3], bl, AREA);
|
|
||||||
}
|
|
||||||
if (disguised(bl)) {
|
if (disguised(bl)) {
|
||||||
WBUFL(buf,2) = -bl->id;
|
WBUFL(buf,2) = -bl->id;
|
||||||
clif_send(buf, packet_len_table[0x1f3], bl, SELF);
|
clif_send(buf, packet_len_table[0x1f3], bl, SELF);
|
||||||
|
@ -28,6 +28,33 @@ struct packet_db {
|
|||||||
short pos[20];
|
short pos[20];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// local define
|
||||||
|
enum {
|
||||||
|
ALL_CLIENT,
|
||||||
|
ALL_SAMEMAP,
|
||||||
|
AREA,
|
||||||
|
AREA_WOS,
|
||||||
|
AREA_WOC,
|
||||||
|
AREA_WOSC,
|
||||||
|
AREA_CHAT_WOC,
|
||||||
|
CHAT,
|
||||||
|
CHAT_WOS,
|
||||||
|
CHAT_MAINCHAT,
|
||||||
|
PARTY,
|
||||||
|
PARTY_WOS,
|
||||||
|
PARTY_SAMEMAP,
|
||||||
|
PARTY_SAMEMAP_WOS,
|
||||||
|
PARTY_AREA,
|
||||||
|
PARTY_AREA_WOS,
|
||||||
|
GUILD,
|
||||||
|
GUILD_WOS,
|
||||||
|
GUILD_SAMEMAP, // [Valaris]
|
||||||
|
GUILD_SAMEMAP_WOS,
|
||||||
|
GUILD_AREA,
|
||||||
|
GUILD_AREA_WOS, // end additions [Valaris]
|
||||||
|
SELF
|
||||||
|
};
|
||||||
|
|
||||||
extern struct packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB];
|
extern struct packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB];
|
||||||
|
|
||||||
void clif_setip(char*);
|
void clif_setip(char*);
|
||||||
|
@ -669,8 +669,8 @@ struct {
|
|||||||
{buildin_petskillsupport,"petskillsupport","iiiii"}, // [Skotlex]
|
{buildin_petskillsupport,"petskillsupport","iiiii"}, // [Skotlex]
|
||||||
{buildin_skilleffect,"skilleffect","ii"}, // skill effect [Celest]
|
{buildin_skilleffect,"skilleffect","ii"}, // skill effect [Celest]
|
||||||
{buildin_npcskilleffect,"npcskilleffect","iiii"}, // npc skill effect [Valaris]
|
{buildin_npcskilleffect,"npcskilleffect","iiii"}, // npc skill effect [Valaris]
|
||||||
{buildin_specialeffect,"specialeffect","i"}, // npc skill effect [Valaris]
|
{buildin_specialeffect,"specialeffect","i*"}, // npc skill effect [Valaris]
|
||||||
{buildin_specialeffect2,"specialeffect2","i"}, // skill effect on players[Valaris]
|
{buildin_specialeffect2,"specialeffect2","i*"}, // skill effect on players[Valaris]
|
||||||
{buildin_nude,"nude",""}, // nude command [Valaris]
|
{buildin_nude,"nude",""}, // nude command [Valaris]
|
||||||
{buildin_mapwarp,"mapwarp","ssii"}, // Added by RoVeRT
|
{buildin_mapwarp,"mapwarp","ssii"}, // Added by RoVeRT
|
||||||
{buildin_inittimer,"inittimer",""},
|
{buildin_inittimer,"inittimer",""},
|
||||||
@ -8646,7 +8646,7 @@ int buildin_specialeffect(struct script_state *st)
|
|||||||
if(bl==NULL)
|
if(bl==NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
clif_specialeffect(bl,conv_num(st,& (st->stack->stack_data[st->start+2])), 0);
|
clif_specialeffect(bl,conv_num(st,& (st->stack->stack_data[st->start+2])), ((st->end > st->start+3)?conv_num(st,& (st->stack->stack_data[st->start+3])):AREA));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -8658,7 +8658,7 @@ int buildin_specialeffect2(struct script_state *st)
|
|||||||
if(sd==NULL)
|
if(sd==NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
clif_specialeffect(&sd->bl,conv_num(st,& (st->stack->stack_data[st->start+2])), 0);
|
clif_specialeffect(&sd->bl,conv_num(st,& (st->stack->stack_data[st->start+2])), ((st->end > st->start+3)?conv_num(st,& (st->stack->stack_data[st->start+3])):AREA));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5206,7 +5206,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|
|||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
eff = rand() % 14;
|
eff = rand() % 14;
|
||||||
clif_specialeffect(bl, 523 + eff, 0);
|
clif_specialeffect(bl, 523 + eff, AREA);
|
||||||
switch (eff)
|
switch (eff)
|
||||||
{
|
{
|
||||||
case 0: // heals SP to 0
|
case 0: // heals SP to 0
|
||||||
@ -10106,7 +10106,7 @@ int skill_produce_mix( struct map_session_data *sd, int skill_id,
|
|||||||
break;
|
break;
|
||||||
default: //Those that don't require a skill?
|
default: //Those that don't require a skill?
|
||||||
if (skill_produce_db[idx].itemlv==11) //Cooking items.
|
if (skill_produce_db[idx].itemlv==11) //Cooking items.
|
||||||
clif_specialeffect(&sd->bl, 608, 0);
|
clif_specialeffect(&sd->bl, 608, AREA);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10146,7 +10146,7 @@ int skill_produce_mix( struct map_session_data *sd, int skill_id,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (skill_produce_db[idx].itemlv==11)
|
if (skill_produce_db[idx].itemlv==11)
|
||||||
clif_specialeffect(&sd->bl, 609, 0);
|
clif_specialeffect(&sd->bl, 609, AREA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user