diff options
author | Paradox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-10-11 06:17:49 +0000 |
---|---|---|
committer | Paradox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-10-11 06:17:49 +0000 |
commit | a0d5cefbeed3b697692ce31d008533a8a69da4b1 (patch) | |
tree | 18233cc106236397404bfd01c0258abff8cad8dc /src/map | |
parent | 6ce604ea27be125d26422dfe3690608e3f1fa8d7 (diff) | |
download | hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.tar.gz hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.tar.bz2 hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.tar.xz hercules-a0d5cefbeed3b697692ce31d008533a8a69da4b1.zip |
Implemented official cash food behavior, including use delay, not being dispelled (including on death), distinct status effects and icons from the ordinary food types.
Updated items accordingly. (bugreport:2560)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14426 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/itemdb.h | 1 | ||||
-rw-r--r-- | src/map/pc.c | 11 | ||||
-rw-r--r-- | src/map/pc.h | 1 | ||||
-rw-r--r-- | src/map/skill.c | 56 | ||||
-rw-r--r-- | src/map/status.c | 37 | ||||
-rw-r--r-- | src/map/status.h | 18 |
8 files changed, 91 insertions, 35 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 2a7b4de18..fde6402a3 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3755,6 +3755,7 @@ static const struct _battle_data { { "combo_delay_rate", &battle_config.combo_delay_rate, 100, 0, INT_MAX, }, { "item_check", &battle_config.item_check, 0, 0, 1, }, { "item_use_interval", &battle_config.item_use_interval, 100, 0, INT_MAX, }, + { "cashfood_use_interval", &battle_config.cashfood_use_interval, 60000, 0, INT_MAX, }, { "wedding_modifydisplay", &battle_config.wedding_modifydisplay, 0, 0, 1, }, { "wedding_ignorepalette", &battle_config.wedding_ignorepalette, 0, 0, 1, }, { "xmas_ignorepalette", &battle_config.xmas_ignorepalette, 0, 0, 1, }, diff --git a/src/map/battle.h b/src/map/battle.h index 361867a9f..230a86007 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -214,6 +214,7 @@ extern struct Battle_Config int combo_delay_rate; int item_check; int item_use_interval; //[Skotlex] + int cashfood_use_interval; int wedding_modifydisplay; int wedding_ignorepalette; //[Skotlex] int xmas_ignorepalette; // [Valaris] diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 5a3c042f6..62bbb2c5a 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -17,6 +17,7 @@ #define ITEMID_TRAP 1065 #define ITEMID_STONE 7049 #define ITEMID_SKULL_ 7420 +#define itemdb_iscashfood(id) ( (id) >= 12202 && (id) <= 12207 ) //The only item group required by the code to be known. See const.txt for the full list. #define IG_FINDINGORE 6 diff --git a/src/map/pc.c b/src/map/pc.c index 808d47792..72fc4da90 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -851,6 +851,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim sd->pvp_timer = INVALID_TIMER; sd->canuseitem_tick = tick; + sd->canusecashfood_tick = tick; sd->canequip_tick = tick; sd->cantalk_tick = tick; sd->cansendmail_tick = tick; @@ -3666,7 +3667,9 @@ int pc_useitem(struct map_session_data *sd,int n) return 0; //Prevent mass item usage. [Skotlex] - if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 ) + if( DIFF_TICK(sd->canuseitem_tick, tick) > 0 || + (itemdb_iscashfood(sd->status.inventory[n].nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0) + ) return 0; if( sd->sc.count && ( @@ -3718,7 +3721,11 @@ int pc_useitem(struct map_session_data *sd,int n) potion_flag = 3; //Even more effective potions. } - sd->canuseitem_tick= tick + battle_config.item_use_interval; //Update item use time. + //Update item use time. + sd->canuseitem_tick = tick + battle_config.item_use_interval; + if( itemdb_iscashfood(sd->status.inventory[n].nameid) ) + sd->canusecashfood_tick = tick + battle_config.cashfood_use_interval; + run_script(script,0,sd->bl.id,fake_nd->bl.id); potion_flag = 0; return 1; diff --git a/src/map/pc.h b/src/map/pc.h index 9c8b524af..da666f9a7 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -199,6 +199,7 @@ struct map_session_data { int invincible_timer; unsigned int canlog_tick; unsigned int canuseitem_tick; // [Skotlex] + unsigned int canusecashfood_tick; unsigned int canequip_tick; // [Inkfish] unsigned int cantalk_tick; unsigned int cansendmail_tick; // [Mail System Flood Protection] diff --git a/src/map/skill.c b/src/map/skill.c index b3dd475a1..c7b60661e 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4739,33 +4739,35 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in if (!tsc->data[i]) continue; switch (i) { - case SC_WEIGHT50: case SC_WEIGHT90: case SC_HALLUCINATION: - case SC_STRIPWEAPON: case SC_STRIPSHIELD: case SC_STRIPARMOR: - case SC_STRIPHELM: case SC_CP_WEAPON: case SC_CP_SHIELD: - case SC_CP_ARMOR: case SC_CP_HELM: case SC_COMBO: - case SC_STRFOOD: case SC_AGIFOOD: case SC_VITFOOD: - case SC_INTFOOD: case SC_DEXFOOD: case SC_LUKFOOD: - case SC_HITFOOD: case SC_FLEEFOOD: case SC_BATKFOOD: - case SC_WATKFOOD: case SC_MATKFOOD: case SC_DANCING: - case SC_GUILDAURA: case SC_EDP: case SC_AUTOBERSERK: - case SC_CARTBOOST: case SC_MELTDOWN: case SC_SAFETYWALL: - case SC_SMA: case SC_SPEEDUP0: case SC_NOCHAT: - case SC_ANKLE: case SC_SPIDERWEB: case SC_JAILED: - case SC_ITEMBOOST: case SC_EXPBOOST: case SC_LIFEINSURANCE: - case SC_BOSSMAPINFO: case SC_PNEUMA: case SC_AUTOSPELL: - case SC_INCHITRATE: case SC_INCATKRATE: case SC_NEN: - case SC_READYSTORM: case SC_READYDOWN: case SC_READYTURN: - case SC_READYCOUNTER:case SC_DODGE: case SC_WARM: - case SC_SPEEDUP1: case SC_AUTOTRADE: case SC_CRITICALWOUND: - case SC_JEXPBOOST: case SC_INVINCIBLE: case SC_INVINCIBLEOFF: - case SC_HELLPOWER: case SC_MANU_ATK: case SC_MANU_DEF: - case SC_SPL_ATK: case SC_SPL_DEF: case SC_MANU_MATK: - case SC_SPL_MATK: case SC_RICHMANKIM: case SC_ETERNALCHAOS: - case SC_DRUMBATTLE: case SC_NIBELUNGEN: case SC_ROKISWEIL: - case SC_INTOABYSS: case SC_SIEGFRIED: case SC_WHISTLE: - case SC_ASSNCROS: case SC_POEMBRAGI: case SC_APPLEIDUN: - case SC_HUMMING: case SC_DONTFORGETME: case SC_FORTUNE: - case SC_SERVICE4U: + case SC_WEIGHT50: case SC_WEIGHT90: case SC_HALLUCINATION: + case SC_STRIPWEAPON: case SC_STRIPSHIELD: case SC_STRIPARMOR: + case SC_STRIPHELM: case SC_CP_WEAPON: case SC_CP_SHIELD: + case SC_CP_ARMOR: case SC_CP_HELM: case SC_COMBO: + case SC_STRFOOD: case SC_AGIFOOD: case SC_VITFOOD: + case SC_INTFOOD: case SC_DEXFOOD: case SC_LUKFOOD: + case SC_HITFOOD: case SC_FLEEFOOD: case SC_BATKFOOD: + case SC_WATKFOOD: case SC_MATKFOOD: case SC_DANCING: + case SC_GUILDAURA: case SC_EDP: case SC_AUTOBERSERK: + case SC_CARTBOOST: case SC_MELTDOWN: case SC_SAFETYWALL: + case SC_SMA: case SC_SPEEDUP0: case SC_NOCHAT: + case SC_ANKLE: case SC_SPIDERWEB: case SC_JAILED: + case SC_ITEMBOOST: case SC_EXPBOOST: case SC_LIFEINSURANCE: + case SC_BOSSMAPINFO: case SC_PNEUMA: case SC_AUTOSPELL: + case SC_INCHITRATE: case SC_INCATKRATE: case SC_NEN: + case SC_READYSTORM: case SC_READYDOWN: case SC_READYTURN: + case SC_READYCOUNTER: case SC_DODGE: case SC_WARM: + case SC_SPEEDUP1: case SC_AUTOTRADE: case SC_CRITICALWOUND: + case SC_JEXPBOOST: case SC_INVINCIBLE: case SC_INVINCIBLEOFF: + case SC_HELLPOWER: case SC_MANU_ATK: case SC_MANU_DEF: + case SC_SPL_ATK: case SC_SPL_DEF: case SC_MANU_MATK: + case SC_SPL_MATK: case SC_RICHMANKIM: case SC_ETERNALCHAOS: + case SC_DRUMBATTLE: case SC_NIBELUNGEN: case SC_ROKISWEIL: + case SC_INTOABYSS: case SC_SIEGFRIED: case SC_WHISTLE: + case SC_ASSNCROS: case SC_POEMBRAGI: case SC_APPLEIDUN: + case SC_HUMMING: case SC_DONTFORGETME: case SC_FORTUNE: + case SC_SERVICE4U: case SC_FOOD_STR_CASH: case SC_FOOD_AGI_CASH: + case SC_FOOD_VIT_CASH: case SC_FOOD_DEX_CASH: case SC_FOOD_INT_CASH: + case SC_FOOD_LUK_CASH: continue; case SC_ASSUMPTIO: if( bl->type == BL_MOB ) diff --git a/src/map/status.c b/src/map/status.c index 4dc84652a..91e742323 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -486,6 +486,12 @@ void initChangeTables(void) StatusIconChangeTable[SC_MANU_MATK] = SI_MANU_MATK; StatusIconChangeTable[SC_SPL_MATK] = SI_SPL_MATK; //Cash Items + StatusIconChangeTable[SC_FOOD_STR_CASH] = SI_FOOD_STR_CASH; + StatusIconChangeTable[SC_FOOD_AGI_CASH] = SI_FOOD_AGI_CASH; + StatusIconChangeTable[SC_FOOD_VIT_CASH] = SI_FOOD_VIT_CASH; + StatusIconChangeTable[SC_FOOD_DEX_CASH] = SI_FOOD_DEX_CASH; + StatusIconChangeTable[SC_FOOD_INT_CASH] = SI_FOOD_INT_CASH; + StatusIconChangeTable[SC_FOOD_LUK_CASH] = SI_FOOD_LUK_CASH; StatusIconChangeTable[SC_EXPBOOST] = SI_EXPBOOST; StatusIconChangeTable[SC_ITEMBOOST] = SI_ITEMBOOST; StatusIconChangeTable[SC_JEXPBOOST] = SI_CASH_PLUSONLYJOBEXP; @@ -550,6 +556,13 @@ void initChangeTables(void) StatusChangeFlagTable[SC_SPCOST_RATE] |= SCB_ALL; StatusChangeFlagTable[SC_WALKSPEED] |= SCB_SPEED; StatusChangeFlagTable[SC_ITEMSCRIPT] |= SCB_ALL; + // Cash Items + StatusChangeFlagTable[SC_FOOD_STR_CASH] = SCB_STR; + StatusChangeFlagTable[SC_FOOD_AGI_CASH] = SCB_AGI; + StatusChangeFlagTable[SC_FOOD_VIT_CASH] = SCB_VIT; + StatusChangeFlagTable[SC_FOOD_DEX_CASH] = SCB_DEX; + StatusChangeFlagTable[SC_FOOD_INT_CASH] = SCB_INT; + StatusChangeFlagTable[SC_FOOD_LUK_CASH] = SCB_LUK; // Mercenary Bonus Effects StatusChangeFlagTable[SC_MERC_FLEEUP] |= SCB_FLEE; StatusChangeFlagTable[SC_MERC_ATKUP] |= SCB_WATK; @@ -3192,6 +3205,8 @@ static unsigned short status_calc_str(struct block_list *bl, struct status_chang str += sc->data[SC_INCSTR]->val1; if(sc->data[SC_STRFOOD]) str += sc->data[SC_STRFOOD]->val1; + if(sc->data[SC_FOOD_STR_CASH]) + str += sc->data[SC_FOOD_STR_CASH]->val1; if(sc->data[SC_BATTLEORDERS]) str += 5; if(sc->data[SC_GUILDAURA] && sc->data[SC_GUILDAURA]->val3>>16) @@ -3233,6 +3248,8 @@ static unsigned short status_calc_agi(struct block_list *bl, struct status_chang agi += sc->data[SC_INCAGI]->val1; if(sc->data[SC_AGIFOOD]) agi += sc->data[SC_AGIFOOD]->val1; + if(sc->data[SC_FOOD_AGI_CASH]) + agi += sc->data[SC_FOOD_AGI_CASH]->val1; if(sc->data[SC_GUILDAURA] && (sc->data[SC_GUILDAURA]->val4)>>16) agi += (sc->data[SC_GUILDAURA]->val4)>>16; if(sc->data[SC_TRUESIGHT]) @@ -3268,6 +3285,8 @@ static unsigned short status_calc_vit(struct block_list *bl, struct status_chang vit += sc->data[SC_INCVIT]->val1; if(sc->data[SC_VITFOOD]) vit += sc->data[SC_VITFOOD]->val1; + if(sc->data[SC_FOOD_VIT_CASH]) + vit += sc->data[SC_FOOD_VIT_CASH]->val1; if(sc->data[SC_CHANGE]) vit += sc->data[SC_CHANGE]->val2; if(sc->data[SC_GUILDAURA] && sc->data[SC_GUILDAURA]->val3&0xFFFF) @@ -3297,6 +3316,8 @@ static unsigned short status_calc_int(struct block_list *bl, struct status_chang int_ += sc->data[SC_INCINT]->val1; if(sc->data[SC_INTFOOD]) int_ += sc->data[SC_INTFOOD]->val1; + if(sc->data[SC_FOOD_INT_CASH]) + int_ += sc->data[SC_FOOD_INT_CASH]->val1; if(sc->data[SC_CHANGE]) int_ += sc->data[SC_CHANGE]->val3; if(sc->data[SC_BATTLEORDERS]) @@ -3337,6 +3358,8 @@ static unsigned short status_calc_dex(struct block_list *bl, struct status_chang dex += sc->data[SC_INCDEX]->val1; if(sc->data[SC_DEXFOOD]) dex += sc->data[SC_DEXFOOD]->val1; + if(sc->data[SC_FOOD_DEX_CASH]) + dex += sc->data[SC_FOOD_DEX_CASH]->val1; if(sc->data[SC_BATTLEORDERS]) dex += 5; if(sc->data[SC_GUILDAURA] && sc->data[SC_GUILDAURA]->val4&0xFFFF) @@ -3376,6 +3399,8 @@ static unsigned short status_calc_luk(struct block_list *bl, struct status_chang luk += sc->data[SC_INCLUK]->val1; if(sc->data[SC_LUKFOOD]) luk += sc->data[SC_LUKFOOD]->val1; + if(sc->data[SC_FOOD_LUK_CASH]) + luk += sc->data[SC_FOOD_LUK_CASH]->val1; if(sc->data[SC_TRUESIGHT]) luk += 5; if(sc->data[SC_GLORIA]) @@ -6274,6 +6299,12 @@ int status_change_clear(struct block_list* bl, int type) case SC_HELLPOWER: case SC_JEXPBOOST: case SC_AUTOTRADE: + case SC_FOOD_STR_CASH: + case SC_FOOD_AGI_CASH: + case SC_FOOD_VIT_CASH: + case SC_FOOD_DEX_CASH: + case SC_FOOD_INT_CASH: + case SC_FOOD_LUK_CASH: continue; } @@ -7302,6 +7333,12 @@ int status_change_clear_buffs (struct block_list* bl, int type) case SC_BATKFOOD: case SC_WATKFOOD: case SC_MATKFOOD: + case SC_FOOD_STR_CASH: + case SC_FOOD_AGI_CASH: + case SC_FOOD_VIT_CASH: + case SC_FOOD_DEX_CASH: + case SC_FOOD_INT_CASH: + case SC_FOOD_LUK_CASH: continue; //Debuffs that can be removed. diff --git a/src/map/status.h b/src/map/status.h index e2ec346a4..e46494a36 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -323,6 +323,12 @@ typedef enum sc_type { SC_SPL_DEF, //300 SC_MANU_MATK, SC_SPL_MATK, + SC_FOOD_STR_CASH, + SC_FOOD_AGI_CASH, + SC_FOOD_VIT_CASH, + SC_FOOD_DEX_CASH, + SC_FOOD_INT_CASH, + SC_FOOD_LUK_CASH, SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; @@ -601,12 +607,12 @@ enum si_type { // SI_DA_EDARKNESS = 268, // SI_DA_EGUARDIAN = 269, // SI_DA_TIMEOUT = 270, -// SI_FOOD_STR_CASH = 271, -// SI_FOOD_AGI_CASH = 272, -// SI_FOOD_VIT_CASH = 273, -// SI_FOOD_DEX_CASH = 274, -// SI_FOOD_INT_CASH = 275, -// SI_FOOD_LUK_CASH = 276, + SI_FOOD_STR_CASH = 271, + SI_FOOD_AGI_CASH = 272, + SI_FOOD_VIT_CASH = 273, + SI_FOOD_DEX_CASH = 274, + SI_FOOD_INT_CASH = 275, + SI_FOOD_LUK_CASH = 276, SI_MERC_FLEEUP = 277, SI_MERC_ATKUP = 278, SI_MERC_HPUP = 279, |