summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJedzkie <jedzkie13@rocketmail.com>2017-04-17 22:23:32 +0800
committerJedzkie <jedzkie13@rocketmail.com>2017-04-23 13:59:59 +0800
commit98a96e7d4977d50b2b5553786a4994e07fbba528 (patch)
tree4eb21b46527f5bb072f38633984e40ba7b7bfba8 /src
parent5802b22439441be1914ae9024d6ce06d51c0210f (diff)
downloadhercules-98a96e7d4977d50b2b5553786a4994e07fbba528.tar.gz
hercules-98a96e7d4977d50b2b5553786a4994e07fbba528.tar.bz2
hercules-98a96e7d4977d50b2b5553786a4994e07fbba528.tar.xz
hercules-98a96e7d4977d50b2b5553786a4994e07fbba528.zip
Implemented official Giant Fly Wing Effect
Update the *warpparty script commmand, credits to Dastgir Coding-style fixes & whitespace adjustments in warpparty part in script.c
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.h50
-rw-r--r--src/map/pc.c36
-rw-r--r--src/map/script.c123
3 files changed, 124 insertions, 85 deletions
diff --git a/src/map/clif.h b/src/map/clif.h
index e16655c1a..8af745337 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -358,30 +358,32 @@ typedef enum useskill_fail_cause { // clif_skill_fail
}useskill_fail_cause;
enum clif_messages {
- MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight.
- MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting.
- MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired.
- MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died.
- MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary.
- MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away.
- MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area
- MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area.
- MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public.
- MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted.
- MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on
- MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount.
- MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab.
- MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done.
- MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found.
- MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found.
- MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found.
- MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials.
- MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found.
- MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found.
- MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be.
- MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use
- MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found.
- MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found.
+ MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight.
+ MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting.
+ MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired.
+ MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died.
+ MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary.
+ MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away.
+ MSG_PARTY_MEMBER_NOT_SUMMONED = 0x4c5, ///< The party member was not summoned because you are not the party leader.
+ MSG_PARTY_NO_MEMBER_IN_MAP = 0x4c6, ///< There is no party member to summon in the current map.
+ MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area
+ MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area.
+ MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public.
+ MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted.
+ MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on
+ MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount.
+ MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab.
+ MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done.
+ MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found.
+ MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found.
+ MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found.
+ MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials.
+ MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found.
+ MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found.
+ MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be.
+ MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use
+ MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found.
+ MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found.
};
/**
diff --git a/src/map/pc.c b/src/map/pc.c
index e9855c16d..30c07a58e 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4847,10 +4847,40 @@ int pc_isUseitem(struct map_session_data *sd,int n)
if( pc_issit(sd) )
return 0;
break;
+
+ case ITEMID_GIANT_FLY_WING: {
+ struct party_data *p;
+
+ if (!sd->status.party_id) {
+ clif->msgtable(sd, MSG_PARTY_MEMBER_NOT_SUMMONED);
+ break;
+ }
+
+ if ((p = party->search(sd->status.party_id)) != NULL) {
+ int i;
+ int16 m;
+
+ ARR_FIND(0, MAX_PARTY, i, p->data[i].sd == sd);
+
+ if (i == MAX_PARTY || !p->party.member[i].leader) {
+ clif->msgtable(sd, MSG_PARTY_MEMBER_NOT_SUMMONED);
+ break;
+ }
+
+ m = sd->bl.m;
+
+ ARR_FIND(0, MAX_PARTY, i, p->data[i].sd && p->data[i].sd != sd && p->data[i].sd->bl.m == m);
+
+ if (i == MAX_PARTY || pc_isdead(p->data[i].sd)) {
+ clif->msgtable(sd, MSG_PARTY_NO_MEMBER_IN_MAP);
+ break;
+ }
+ }
+ }
+ FALLTHROUGH
case ITEMID_WING_OF_FLY:
- case ITEMID_GIANT_FLY_WING:
- if( map->list[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m) ) {
- clif->skill_mapinfomessage(sd,0);
+ if (map->list[sd->bl.m].flag.noteleport || map_flag_gvg2(sd->bl.m)) {
+ clif->skill_mapinfomessage(sd, 0);
return 0;
}
/* Fall through */
diff --git a/src/map/script.c b/src/map/script.c
index 8604b62f7..61022252f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6690,9 +6690,10 @@ BUILDIN(warpchar) {
return true;
}
/*==========================================
- * Warpparty - [Fredzilla] [Paradox924X]
- * Syntax: warpparty "to_mapname",x,y,Party_ID,{"from_mapname"};
+ * Warpparty - [Fredzilla] [Paradox924X] [Jedzkie] [Dastgir]
+ * Syntax: warpparty("<to_mapname>", <x>, <y>, <party_id>, "<from_mapname>", <include_leader>)
* If 'from_mapname' is specified, only the party members on that map will be warped
+ * If 'include_leader' option is set to false, the leader will be warped too.
*------------------------------------------*/
BUILDIN(warpparty)
{
@@ -6702,78 +6703,84 @@ BUILDIN(warpparty)
int type;
int map_index;
int i;
+ bool include_leader = true;
- const char* str = script_getstr(st,2);
- int x = script_getnum(st,3);
- int y = script_getnum(st,4);
- int p_id = script_getnum(st,5);
+ const char* str = script_getstr(st, 2);
+ int x = script_getnum(st, 3);
+ int y = script_getnum(st, 4);
+ int p_id = script_getnum(st, 5);
const char* str2 = NULL;
- if ( script_hasdata(st,6) )
- str2 = script_getstr(st,6);
+
+ if (script_hasdata(st, 6))
+ str2 = script_getstr(st, 6);
+ if (script_hasdata(st, 7))
+ include_leader = script_getnum(st, 7);
p = party->search(p_id);
- if(!p)
+
+ if (p == NULL)
return true;
- type = ( strcmp(str,"Random")==0 ) ? 0
- : ( strcmp(str,"SavePointAll")==0 ) ? 1
- : ( strcmp(str,"SavePoint")==0 ) ? 2
- : ( strcmp(str,"Leader")==0 ) ? 3
+ type = (strcmp(str, "Random") == 0) ? 0
+ : (strcmp(str, "SavePointAll") == 0) ? 1
+ : (strcmp(str, "SavePoint") == 0) ? 2
+ : (strcmp(str, "Leader") == 0) ? 3
: 4;
- switch (type)
- {
- case 3:
- for(i = 0; i < MAX_PARTY && !p->party.member[i].leader; i++);
- if (i == MAX_PARTY || !p->data[i].sd) //Leader not found / not online
- return true;
- pl_sd = p->data[i].sd;
- map_index = pl_sd->mapindex;
- x = pl_sd->bl.x;
- y = pl_sd->bl.y;
- break;
- case 4:
- map_index = script->mapindexname2id(st,str);
- break;
- case 2:
- //"SavePoint" uses save point of the currently attached player
- if (( sd = script->rid2sd(st) ) == NULL )
- return true;
- /* Fall through */
- default:
- map_index = 0;
- break;
+ switch (type) {
+ case 3:
+ ARR_FIND(0, MAX_PARTY, i, p->party.member[i].leader);
+ if (i == MAX_PARTY || !p->data[i].sd) // Leader not found / not online
+ return true;
+ pl_sd = p->data[i].sd;
+ map_index = pl_sd->mapindex;
+ x = pl_sd->bl.x;
+ y = pl_sd->bl.y;
+ break;
+ case 4:
+ map_index = script->mapindexname2id(st, str);
+ break;
+ case 2:
+ // "SavePoint" uses save point of the currently attached player
+ if ((sd = script->rid2sd(st)) == NULL)
+ return true;
+ /* Fall through */
+ default:
+ map_index = 0;
+ break;
}
for (i = 0; i < MAX_PARTY; i++) {
- if( !(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id )
+ if (!(pl_sd = p->data[i].sd) || pl_sd->status.party_id != p_id)
continue;
- if( str2 && strcmp(str2, map->list[pl_sd->bl.m].name) != 0 )
+ if (str2 && strcmp(str2, map->list[pl_sd->bl.m].name) != 0)
continue;
- if( pc_isdead(pl_sd) )
+ if (pc_isdead(pl_sd))
continue;
- switch( type )
- {
- case 0: // Random
- if(!map->list[pl_sd->bl.m].flag.nowarp)
- pc->randomwarp(pl_sd,CLR_TELEPORT);
- break;
- case 1: // SavePointAll
- if(!map->list[pl_sd->bl.m].flag.noreturn)
- pc->setpos(pl_sd,pl_sd->status.save_point.map,pl_sd->status.save_point.x,pl_sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 2: // SavePoint
- if(!map->list[pl_sd->bl.m].flag.noreturn)
- pc->setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
- break;
- case 3: // Leader
- case 4: // m,x,y
- if(!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp)
- pc->setpos(pl_sd,map_index,x,y,CLR_TELEPORT);
- break;
+ if (include_leader == false && p->party.member[i].leader)
+ continue;
+
+ switch( type ) {
+ case 0: // Random
+ if (!map->list[pl_sd->bl.m].flag.nowarp)
+ pc->randomwarp(pl_sd, CLR_TELEPORT);
+ break;
+ case 1: // SavePointAll
+ if (!map->list[pl_sd->bl.m].flag.noreturn)
+ pc->setpos(pl_sd, pl_sd->status.save_point.map, pl_sd->status.save_point.x, pl_sd->status.save_point.y, CLR_TELEPORT);
+ break;
+ case 2: // SavePoint
+ if (!map->list[pl_sd->bl.m].flag.noreturn)
+ pc->setpos(pl_sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_TELEPORT);
+ break;
+ case 3: // Leader
+ case 4: // m,x,y
+ if (!map->list[pl_sd->bl.m].flag.noreturn && !map->list[pl_sd->bl.m].flag.nowarp)
+ pc->setpos(pl_sd, map_index, x, y, CLR_TELEPORT);
+ break;
}
}
@@ -21524,7 +21531,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(warp,"sii?"),
BUILDIN_DEF(areawarp,"siiiisii??"),
BUILDIN_DEF(warpchar,"siii"), // [LuzZza]
- BUILDIN_DEF(warpparty,"siii?"), // [Fredzilla] [Paradox924X]
+ BUILDIN_DEF(warpparty,"siii??"), // [Fredzilla] [Paradox924X] [Jedzkie] [Dastgir]
BUILDIN_DEF(warpguild,"siii?"), // [Fredzilla]
BUILDIN_DEF(setlook,"ii"),
BUILDIN_DEF(changelook,"ii"), // Simulates but don't Store it