Index: mmo.h =================================================================== --- mmo.h (revision 17181) +++ mmo.h (working copy) @@ -349,7 +349,7 @@ unsigned char karma; short hair,hair_color,clothes_color; int party_id,guild_id,pet_id,hom_id,mer_id,ele_id; - int fame; + int fame,pvprank,aura; // Mercenary Guilds Rank int arch_faith, arch_calls; Index: atcommand.c =================================================================== --- atcommand.c (revision 17181) +++ atcommand.c (working copy) @@ -8036,6 +8036,45 @@ return 0; } + /*========================================== + * Auras personalizadas + *------------------------------------------*/ +ACMD_FUNC(aura) +{ + struct map_session_data *pl_sd = 0; + int type = 0; + + if (!message || !*message || sscanf(message, "%d %[^\n]", &type, atcmd_player_name) < 2) + { + if (!message || !*message || sscanf(message, "%d", &type) < 1) + { + clif_displaymessage(fd, "Please, enter at least an option (usage: @aura )."); + return -1; + } + + atcmd_player_name[0] = 0; + pl_sd = sd; + } + + if( pl_sd != sd ) + { + if ((pl_sd = map_nick2sd(atcmd_player_name)) == NULL) + return -1; + } + + sprintf(atcmd_output, "Current Aura: %d", pl_sd->status.aura); + clif_displaymessage(fd, atcmd_output); + + pl_sd->status.aura = type; + pc_setglobalreg(pl_sd,"USERAURA",type); + + pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, 3); + + return 0; +} + + + /*========================================== * AUCTION SYSTEM *------------------------------------------*/ @@ -9050,7 +9089,8 @@ ACMD_DEF2("rmvperm", addperm), ACMD_DEF(unloadnpcfile), ACMD_DEF(cart), - ACMD_DEF(mount2) + ACMD_DEF(mount2), + ACMD_DEF(aura), }; AtCommandInfo* atcommand; int i; Index: clif.c =================================================================== --- clif.c (revision 17181) +++ clif.c (working copy) @@ -191,6 +191,141 @@ static int clif_parse (int fd); /*========================================== + * @aura + *------------------------------------------*/ +static int auraTable[][3] = { + { -1, -1, -1 }, + // Reserved for PK Mode + { 586, -1, -1 }, // LH + { 586, 362, -1 }, // LH Mvp + { 586, 362, 240 }, // 1? PK Place + // Basic Auras + { 418, -1, -1 }, // Red Fury + { 486, -1, -1 }, // Blue Fury + { 485, -1, -1 }, // White Fury + { 239, -1, -1 }, // Aura Red + { 240, -1, -1 }, // Aura White + { 241, -1, -1 }, // Aura Yellow + { 620, -1, -1 }, // Aura Blue + { 202, -1, -1 }, // Lvl 99 Bubbles + { 362, -1, -1 }, // Advanced Lvl 99 Bubbles + { 678, -1, -1 }, // Brazil Aura Bubbles + { 679, -1, -1 }, // Brazil Aura + { 680, -1, -1 }, // Brazil Aura Floor + // 2 Sets + { 239, 418, -1 }, + { 239, 486, -1 }, + { 239, 485, -1 }, + { 240, 418, -1 }, + { 240, 486, -1 }, + { 240, 485, -1 }, + { 241, 418, -1 }, + { 241, 486, -1 }, + { 241, 485, -1 }, + { 620, 418, -1 }, + { 620, 486, -1 }, + { 620, 485, -1 }, + // Full Sets + { 239, 418, 202 }, + { 239, 486, 202 }, + { 239, 485, 202 }, + { 240, 418, 202 }, + { 240, 486, 202 }, + { 240, 485, 202 }, + { 241, 418, 202 }, + { 241, 486, 202 }, + { 241, 485, 202 }, + { 620, 418, 202 }, + { 620, 486, 202 }, + { 620, 485, 202 }, + { 239, 418, 362 }, + { 239, 486, 362 }, + { 239, 485, 362 }, + { 240, 418, 362 }, + { 240, 486, 362 }, + { 240, 485, 362 }, + { 241, 418, 362 }, + { 241, 486, 362 }, + { 241, 485, 362 }, + { 620, 418, 362 }, + { 620, 486, 362 }, + { 620, 485, 362 }, + { 239, 418, 678 }, + { 239, 486, 678 }, + { 239, 485, 678 }, + { 240, 418, 678 }, + { 240, 486, 678 }, + { 240, 485, 678 }, + { 241, 418, 678 }, + { 241, 486, 678 }, + { 241, 485, 678 }, + { 620, 418, 678 }, + { 620, 486, 678 }, + { 620, 485, 678 }, + // Oficial Set + { 680, 679, 678 }, + { -1, -1, -1 } +}; + +int aura_getSize() +{ + return sizeof(auraTable)/(sizeof(int) * 3) - 1; +} + +int aura_getAuraEffect(struct map_session_data *sd, short pos) +{ + int aura = sd->status.aura; + + if (pos < 0 || pos > 2) + return -1; + + if (aura > aura_getSize() || aura < 0) + return -1; + + return auraTable[aura][pos]; +} + +void clif_sendaurastoone(struct map_session_data *sd, struct map_session_data *dsd) +{ + int effect1, effect2, effect3; + + if (pc_ishiding(sd)) + return; + + effect1 = aura_getAuraEffect(sd, 0); + effect2 = aura_getAuraEffect(sd, 1); + effect3 = aura_getAuraEffect(sd, 2); + + if (effect1 >= 0) + clif_specialeffect_single(&sd->bl, effect1, dsd->fd); + if (effect2 >= 0) + clif_specialeffect_single(&sd->bl, effect2, dsd->fd); + if (effect3 >= 0) + clif_specialeffect_single(&sd->bl, effect3, dsd->fd); +} + +void clif_sendauras(struct map_session_data *sd, enum send_target type) +{ + int effect1, effect2, effect3; + + if (pc_ishiding(sd)) + return; + + effect1 = aura_getAuraEffect(sd, 0); + effect2 = aura_getAuraEffect(sd, 1); + effect3 = aura_getAuraEffect(sd, 2); + + if (effect1 >= 0) + clif_specialeffect(&sd->bl, effect1, type); + if (effect2 >= 0) + clif_specialeffect(&sd->bl, effect2, type); + if (effect3 >= 0) + clif_specialeffect(&sd->bl, effect3, type); +} + + + +/*========================================== * Ip setting of map-server *------------------------------------------*/ int clif_setip(const char* ip) @@ -1359,6 +1494,7 @@ clif_specialeffect(bl,423,AREA); else if(sd->state.size==SZ_MEDIUM) clif_specialeffect(bl,421,AREA); + clif_sendauras((TBL_PC*)bl, AREA); if( sd->bg_id && map[sd->bl.m].flag.battleground ) clif_sendbgemblem_area(sd); if( sd->sc.option&OPTION_MOUNTING ) { @@ -4103,6 +4239,7 @@ clif_specialeffect_single(bl,423,sd->fd); else if(tsd->state.size==SZ_MEDIUM) clif_specialeffect_single(bl,421,sd->fd); + clif_sendaurastoone(tsd, sd); if( tsd->bg_id && map[tsd->bl.m].flag.battleground ) clif_sendbgemblem_single(sd->fd,tsd); if( tsd->sc.data[SC_CAMOUFLAGE] ) @@ -4150,6 +4287,37 @@ } } +int clif_insight2(struct block_list *bl,va_list ap) +{ + struct block_list *tbl; + struct map_session_data *sd, *tsd; + int flag; + + tbl = va_arg(ap,struct block_list*); + flag = va_arg(ap,int); + + if (bl == tbl && !flag) + return 0; + + sd = BL_CAST(BL_PC, bl); + tsd = BL_CAST(BL_PC, tbl); + + if (sd && sd->fd) + { + if (bl == tbl) + clif_sendaurastoone(sd, tsd); + else + clif_getareachar_unit(sd, tbl); + } + + return 0; +} + +void clif_getareachar_char(struct block_list *bl, short flag) +{ + map_foreachinarea(clif_insight2, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE,BL_PC, bl, flag); +} + //Modifies the type of damage according to status changes [Skotlex] //Aegis data specifies that: 4 endure against single hit sources, 9 against multi-hit. static inline int clif_calc_delay(int type, int div, int damage, int delay) Index: clif.h =================================================================== --- clif.h (revision 17181) +++ clif.h (working copy) @@ -655,6 +655,10 @@ int do_init_clif(void); void do_final_clif(void); +// [@aura] +void clif_sendauras(struct map_session_data *sd, enum send_target type); +void clif_getareachar_char(struct block_list *bl, short flag); + // MAIL SYSTEM void clif_Mail_window(int fd, int flag); void clif_Mail_read(struct map_session_data *sd, int mail_id); Index: pc.c =================================================================== --- pc.c (revision 17181) +++ pc.c (working copy) @@ -1147,6 +1147,9 @@ sd->change_level_3rd = pc_readglobalreg(sd,"jobchange_level_3rd"); sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER"); + // @Aura + sd->status.aura = pc_readglobalreg(sd,"USERAURA"); + // Cash shop sd->cashPoints = pc_readaccountreg(sd,"#CASHPOINTS"); sd->kafraPoints = pc_readaccountreg(sd,"#KAFRAPOINTS"); Index: status.c =================================================================== --- status.c (revision 17181) +++ status.c (working copy) @@ -7210,6 +7210,7 @@ vd = status_get_viewdata(bl); calc_flag = StatusChangeFlagTable[type]; if(!(flag&4)) //&4 - Do not parse val settings when loading SCs + { switch(type) { case SC_DECREASEAGI: @@ -8653,6 +8654,15 @@ return 0; } } + // @aura + if (sd && sd->status.aura > 0 && + (type == SC_HIDING || type == SC_CLOAKING || type == SC_CHASEWALK)) + { + sd->status.aura *= -1; + clif_clearunit_area(&sd->bl, 0); + clif_getareachar_char(&sd->bl, 0); + } + } else //Special considerations when loading SC data. switch( type ) { @@ -9781,6 +9791,14 @@ opt_flag = 0; } + // @auras + if (sd && sd->status.aura < 0 && + (type == SC_HIDING || type == SC_CLOAKING || type == SC_CHASEWALK)) + { + sd->status.aura *= -1; + clif_sendauras(sd, AREA_WOS); + } + if (calc_flag&SCB_DYE) { //Restore DYE color if (vd && !vd->cloth_color && sce->val4)