Jump to content
  • 0
Sign in to follow this  
cumbe11

@partybuff / @spb

Question

 I tried to put this mod on my eAthena emulator but give error when will compile .. could someone help me?

Diff

Index: conf/msg_conf/map_msg.conf
===================================================================
--- conf/msg_conf/map_msg.conf (revision 17251)
+++ conf/msg_conf/map_msg.conf (working copy)
@@ -1457,5 +1457,10 @@
 1434: You're already in the '%s' channel.
 1435: You're now in the '#%s' channel for '%s'.
 
+// ----- @partybuff / @spb ----- //
+1450: You're not in a party.
+1451: Displaying party member's buffs disabled.
+1452: Displaying party member's buffs enabled.
+
 //Custom translations
 //import: conf/msg_conf/import/map_msg_eng_conf.txt
Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c (revision 17251)
+++ src/map/atcommand.c (working copy)
@@ -9100,6 +9100,29 @@
  return 0;
 }
 
+ACMD_FUNC(partybuff)
+{
+ struct party_data* p = NULL;
+ nullpo_retr(-1, sd);
+
+    if( !sd->status.party_id ) {
+     clif_displaymessage(fd, msg_txt(sd,1450)); // You're not in a party.
+     return -1;
+    }
+
+ p = party_search(sd->status.party_id);
+
+ if( sd->state.spb ) {
+ sd->state.spb = 0;
+     clif_displaymessage(fd, msg_txt(sd,1451)); // Displaying party member's buffs disabled.
+ } else {
+ sd->state.spb = 1;
+     clif_displaymessage(fd, msg_txt(sd,1452)); // Displaying party member's buffs enabled.
+ }
+
+ clif_party_info(p,sd);
+ return 0;
+}
 /**
  * Fills the reference of available commands in atcommand DBMap
  **/
@@ -9111,6 +9134,8 @@
  **/
  AtCommandInfo atcommand_base[] = {
  ACMD_DEF2("warp", mapmove),
+ ACMD_DEF(partybuff),
+ ACMD_DEF2("spb", partybuff),
  ACMD_DEF(where),
  ACMD_DEF(jumpto),
  ACMD_DEF(jump),
Index: src/map/clif.c
===================================================================
--- src/map/clif.c (revision 17251)
+++ src/map/clif.c (working copy)
@@ -455,6 +455,7 @@
  case PARTY_WOS:
  case PARTY_SAMEMAP:
  case PARTY_SAMEMAP_WOS:
+ case PARTY_BUFF_INFO:
  if (sd && sd->status.party_id)
  p = party_search(sd->status.party_id);
 
@@ -469,12 +470,15 @@
  if( sd->bl.id == bl->id && (type == PARTY_WOS || type == PARTY_SAMEMAP_WOS || type == PARTY_AREA_WOS) )
  continue;
 
- if( type != PARTY && type != PARTY_WOS && bl->m != sd->bl.m )
+ if( type != PARTY_BUFF_INFO && type != PARTY && type != PARTY_WOS && bl->m != sd->bl.m )
  continue;
 
  if( (type == PARTY_AREA || type == PARTY_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
  continue;
 
+ if( type == PARTY_BUFF_INFO && !sd->state.spb )
+ continue;
+
  if( packet_db[sd->packet_ver][RBUFW(buf,0)].len )
  { // packet must exist for the client version
  WFIFOHEAD(fd,len);
@@ -6557,8 +6561,9 @@
 void clif_party_info(struct party_data* p, struct map_session_data *sd)
 {
  unsigned char buf[2+2+NAME_LENGTH+(4+NAME_LENGTH+MAP_NAME_LENGTH_EXT+1+1)*MAX_PARTY];
- struct map_session_data* party_sd = NULL;
+ struct map_session_data* party_sd = NULL, *target = NULL;
  int i, c;
+ char output[NAME_LENGTH+10];
 
  nullpo_retv(p);
 
@@ -6585,6 +6590,33 @@
  } else if (party_sd) { // send to whole party
  clif_send(buf, WBUFW(buf,2), &party_sd->bl, PARTY);
  }
+
+ for(i = 0; i < MAX_PARTY; i++)
+ {
+ if( (target = p->data[i].sd) )
+ {
+ strcpy(output, "[");
+ if( target->sc.data[SC_BLESSING] ) strcat(output,"B");
+ else strcat(output,"_");
+ if( target->sc.data[SC_INCREASEAGI] ) strcat(output,"A");
+ else strcat(output,"_");
+ if( target->sc.data[SC_CP_WEAPON] && target->sc.data[SC_CP_SHIELD] &&
+ target->sc.data[SC_CP_ARMOR] && target->sc.data[SC_CP_HELM] ) strcat(output,"F");
+ else strcat(output,"_");
+ if( target->sc.data[SC_SPIRIT] ) strcat(output,"S");
+ else strcat(output,"_");
+ if( target->sc.data[SC_DEVOTION] ) strcat(output,"+");
+ else strcat(output,"_");
+ strcat(output, "]");
+ strncat(output, p->data[i].sd->status.name, NAME_LENGTH);
+ safestrncpy((char*)WBUFP(buf,28+i*46+4), output, NAME_LENGTH);
+ }
+ }
+
+ if( sd && sd->state.spb )
+ clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
+ else if( party_sd )
+ clif_send(buf, WBUFW(buf,2), &party_sd->bl, PARTY_BUFF_INFO);
 }
 
 
Index: src/map/clif.h
===================================================================
--- src/map/clif.h (revision 17251)
+++ src/map/clif.h (working copy)
@@ -65,6 +65,7 @@
  PARTY_SAMEMAP_WOS,
  PARTY_AREA,
  PARTY_AREA_WOS,
+ PARTY_BUFF_INFO,
  GUILD,
  GUILD_WOS,
  GUILD_SAMEMAP,
Index: src/map/party.c
===================================================================
--- src/map/party.c (revision 17251)
+++ src/map/party.c (working copy)
@@ -563,12 +563,17 @@
  memset(&p->data[i], 0, sizeof(p->data[0]));
  p->party.count--;
  party_check_state(p);
+ clif_party_info(p, NULL);
  }
  }
 
  if( sd && sd->status.party_id == party_id && sd->status.char_id == char_id )
  {
  sd->status.party_id = 0;
+ if( sd->state.spb ) {
+ sd->state.spb = 0;
+ clif_displaymessage(sd->fd, msg_txt(sd,1451));
+ }
  clif_charnameupdate(sd); //Update name display [Skotlex]
  //TODO: hp bars should be cleared too
  if( p->instance_id )
Index: src/map/pc.h
===================================================================
--- src/map/pc.h (revision 17251)
+++ src/map/pc.h (working copy)
@@ -164,6 +164,7 @@
  struct guild *gmaster_flag;
  unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
  unsigned int warping : 1;//states whether you're in the middle of a warp processing
+ unsigned int spb : 1; // @spb / @partybuff
  unsigned int permanent_speed : 1; // When 1, speed cannot be changed through status_calc_pc().
  } state;
  struct {
Index: src/map/status.c
===================================================================
--- src/map/status.c (revision 17251)
+++ src/map/status.c (working copy)
@@ -31,6 +31,7 @@
 #include "mercenary.h"
 #include "elemental.h"
 #include "vending.h"
+#include "party.h"
 
 #include <time.h>
 #include <stdio.h>
@@ -9113,6 +9114,15 @@
  if( opt_flag&2 && sd && sd->touching_id )
  npc_touchnext_areanpc(sd,false); // run OnTouch_ on next char in range
 
+ if( sd && sd->status.party_id && (
+ type == SC_BLESSING || type == SC_INCREASEAGI || type == SC_CP_WEAPON || type == SC_CP_SHIELD ||
+ type == SC_CP_ARMOR || type == SC_CP_HELM || type == SC_SPIRIT || type == SC_DEVOTION )
+ )
+ {
+ struct party_data *p = party_search(sd->status.party_id);
+ clif_party_info(p, NULL);
+ }
+
  return 1;
 }
 
@@ -9884,6 +9894,15 @@
  if(opt_flag&2 && sd && map_getcell(bl->m,bl->x,bl->y,CELL_CHKNPC))
  npc_touch_areanpc(sd,bl->m,bl->x,bl->y); //Trigger on-touch event.
 
+ if( sd && sd->status.party_id && (
+ type == SC_BLESSING || type == SC_INCREASEAGI || type == SC_CP_WEAPON || type == SC_CP_SHIELD ||
+ type == SC_CP_ARMOR || type == SC_CP_HELM || type == SC_SPIRIT || type == SC_DEVOTION )
+ )
+ {
+ struct party_data *p = party_search(sd->status.party_id);
+ clif_party_info(p, NULL);
+ }
+
  ers_free(sc_data_ers, sce);
  return 1;
 }

 

[erro console compiler]

 

clif.c: In function 'clif_bl_type':
clif.c:443: warning: comparison is always true due to limited range of data type
clif.c:445: warning: comparison is always true due to limited range of data type
clif.c: In function 'clif_setdisguise':
clif.c:1469: warning: comparison is always true due to limited range of data type
clif.c: At top level:
clif.c:6670: error: expected identifier or '(' before 'for'
clif.c:6670: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
clif.c:6670: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
clif.c:6692: error: expected identifier or '(' before 'if'
clif.c:6694: error: expected identifier or '(' before 'else'
clif.c:6697: error: expected identifier or '(' before 'return'
clif.c:6698: error: expected identifier or '(' before '}' token
make[1]: *** [obj_sql/clif.o] Error 1
make[1]: Leaving directory `/home/emulador/src/map'
make: *** [map_sql] Error 2
-bash-3.2#
-bash-3.2#

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.