From c0afd048169aa9d66c739ac548df05ed498a0a34 Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Wed, 23 Dec 2015 14:41:23 +0800 Subject: Item Update: - Fix typo MOBID_GUARIDAN to MOBID_GUARDIAN - Added official item effect for Magic Candy. --- src/map/skill.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/skill.c b/src/map/skill.c index 9b06591f4..f82cdee71 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7623,7 +7623,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin // Slim Pitcher case CR_SLIMPITCHER: // Updated to block Slim Pitcher from working on barricades and guardian stones. - if( dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARIDAN_STONE2)) ) + if( dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARDIAN_STONE2)) ) break; if (script->potion_hp || script->potion_sp) { int hp = script->potion_hp, sp = script->potion_sp; @@ -13667,7 +13667,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case SR_CURSEDCIRCLE: if (map_flag_gvg2(sd->bl.m)) { if (map->foreachinrange(mob->count_sub, &sd->bl, skill->get_splash(skill_id, skill_lv), BL_MOB, - MOBID_EMPERIUM, MOBID_GUARIDAN_STONE1, MOBID_GUARIDAN_STONE2)) { + MOBID_EMPERIUM, MOBID_GUARDIAN_STONE1, MOBID_GUARDIAN_STONE2)) { char output[128]; sprintf(output, "You're too close to a stone or emperium to do this skill"); /* TODO official response? or message.conf it */ clif->messagecolor_self(sd->fd, COLOR_RED, output); @@ -14778,6 +14778,8 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 } if (sc->data[SC_FENRIR_CARD]) fixcast_r = max(fixcast_r, sc->data[SC_FENRIR_CARD]->val2); + if (sc->data[SC_MAGIC_CANDY]) + fixcast_r = max(fixcast_r, sc->data[SC_MAGIC_CANDY]->val2); // Fixed cast non percentage bonuses if( sc->data[SC_MANDRAGORA] ) -- cgit v1.2.3-60-g2f50 From 248f245f078ddba531cf771dcd42ad9e0bd0f7c7 Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Wed, 23 Dec 2015 15:27:20 +0800 Subject: Item Update: - Added official effect for Rapid Life Water. - Added new items: - Fruit Salad (http://www.divine-pride.net/database/item/11715) - Shepherd Salad (http://www.divine-pride.net/database/item/11716) - Yogurt (http://www.divine-pride.net/database/item/11717) - Bisket Dessert (http://www.divine-pride.net/database/item/11718) --- db/const.txt | 2 + db/pre-re/item_db.conf | 44 ++++++++++---------- db/re/item_db.conf | 109 ++++++++++++++++++++++++++++++++++++++----------- db/sc_config.txt | 3 +- src/map/skill.c | 2 +- src/map/status.c | 20 ++++++--- src/map/status.h | 2 + 7 files changed, 128 insertions(+), 54 deletions(-) (limited to 'src/map/skill.c') diff --git a/db/const.txt b/db/const.txt index a77a612bf..98883e9cc 100644 --- a/db/const.txt +++ b/db/const.txt @@ -1346,6 +1346,8 @@ SC_PHI_DEMON 635 SC_PROMOTE_HEALTH_RESERCH 636 SC_ENERGY_DRINK_RESERCH 637 SC_MAGIC_CANDY 638 +SC_M_LIFEPOTION 639 +SC_G_LIFEPOTION 640 e_gasp 0 e_what 1 diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf index d5ccd7e97..8d4c99379 100644 --- a/db/pre-re/item_db.conf +++ b/db/pre-re/item_db.conf @@ -87070,13 +87070,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_HEAL3; - sc_start4 SC_S_LIFEPOTION,600000,-5,5,0,0; + sc_start2 SC_S_LIFEPOTION, 600000, -5, 5; "> }, { @@ -87091,13 +87091,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_HEAL3; - sc_start4 SC_L_LIFEPOTION,600000,-7,4,0,0; + sc_start2 SC_L_LIFEPOTION, 600000, -7, 4; "> }, { @@ -87112,13 +87112,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_MAGICALATTHIT; - sc_start SC_CRITICALPERCENT,300000,30; + sc_start SC_CRITICALPERCENT, 300000, 30; "> }, { @@ -87133,13 +87133,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_LIGHTSPHERE; - sc_start SC_HEALPLUS,1800000,20; + sc_start SC_HEALPLUS, 1800000, 20; "> }, { @@ -87155,13 +87155,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_STEAL; - sc_start SC_PLUSAVOIDVALUE,60000,20; + sc_start SC_PLUSAVOIDVALUE, 60000, 20; "> }, { @@ -87176,13 +87176,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_CLOAKING; - sc_start4 SC_ARMOR_PROPERTY,1800000,1,Ele_Dark,1,0; + sc_start4 SC_ARMOR_PROPERTY, 1800000, 1, Ele_Dark, 1, 0; "> }, { @@ -87197,13 +87197,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_BENEDICTIO; - sc_start4 SC_ARMOR_PROPERTY,1800000,1,Ele_Holy,1,0; + sc_start4 SC_ARMOR_PROPERTY, 1800000, 1, Ele_Holy, 1, 0; "> }, { @@ -87218,13 +87218,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_GUARD; - sc_start SC_PROTECT_DEF,60000,3; + sc_start SC_PROTECT_DEF, 60000, 3; "> }, { @@ -87239,13 +87239,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_GUARD; - sc_start SC_PROTECT_DEF,180000,3; + sc_start SC_PROTECT_DEF, 180000, 3; "> }, { @@ -87260,13 +87260,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_SPELLBREAKER; - sc_start SC_PROTECT_MDEF,60000,3; + sc_start SC_PROTECT_MDEF, 60000, 3; "> }, { @@ -87281,13 +87281,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_SPELLBREAKER; - sc_start SC_PROTECT_MDEF,180000,3; + sc_start SC_PROTECT_MDEF, 180000, 3; "> }, { diff --git a/db/re/item_db.conf b/db/re/item_db.conf index b85203710..56eb0e27b 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -76625,6 +76625,63 @@ item_db: ( Weight: 30 Script: <" itemheal rand(40,45),0; "> }, +{ + Id: 11715 + AegisName: "Fruit_Salad" + Name: "Fruit Salad" + Type: 0 + Buy: 0 + Weight: 10 + Script: <" + specialeffect2 EF_SPELLBREAKER; + sc_start SC_TARGET_ASPD, 180000, 10; + "> +}, +{ + Id: 11716 + AegisName: "Shepherd_Salad" + Name: "Shepherd Salad" + Type: 0 + Buy: 0 + Weight: 10 + Script: <" + specialeffect2 EF_LIGHTSPHERE; + sc_start SC_HEALPLUS, 180000, 20; + "> +}, +{ + Id: 11717 + AegisName: "Yogurt" + Name: "Yogurt" + Type: 0 + Buy: 0 + Weight: 140 + Script: <" + specialeffect2 EF_HEAL3; + sc_start2 SC_ATKER_MOVESPEED, 180000, 5, 10; + "> +}, +{ + Id: 11718 + AegisName: "Sushi_Kebab" + Name: "Sushi Kebab" + Type: 0 + Buy: 0 + Weight: 60 + Script: <" + specialeffect2 EF_HEAL3; + sc_start2 SC_M_LIFEPOTION, 180000, -4, 4; + "> +}, +{ + Id: 11719 + AegisName: "Bisket_Dessert" + Name: "Bisket Dessert" + Type: 0 + Buy: 0 + Weight: 200 + Script: <" sc_start SC_CASH_PLUSEXP, 1800000, 100;"> +}, { Id: 12000 AegisName: "Cold_Scroll_2_5" @@ -80268,7 +80325,7 @@ item_db: ( noauction: true nogstorage: true } - Script: <" sc_start2 SC_ATKER_ASPD,3600000,5,10; "> + Script: <" sc_start2 SC_ATKER_ASPD, 3600000, 5, 10; "> }, { Id: 12275 @@ -80287,7 +80344,7 @@ item_db: ( noauction: true nogstorage: true } - Script: <" sc_start2 SC_ATKER_MOVESPEED,3600000,5,10; "> + Script: <" sc_start2 SC_ATKER_MOVESPEED, 3600000, 5, 10; "> }, { Id: 12276 @@ -80647,7 +80704,7 @@ item_db: ( } Script: <" specialeffect2 EF_SPELLBREAKER; - sc_start SC_ATKER_BLOOD,3600000,15; + sc_start SC_ATKER_BLOOD, 3600000, 15; "> }, { @@ -80669,7 +80726,7 @@ item_db: ( } Script: <" specialeffect2 EF_GUARD; - sc_start SC_TARGET_BLOOD,3600000,10; + sc_start SC_TARGET_BLOOD, 3600000, 10; "> }, { @@ -84252,10 +84309,14 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } + Script: <" + specialeffect2 EF_HEAL; + sc_start2 SC_G_LIFEPOTION, 600000, -6, 3; + "> }, { Id: 12579 @@ -110922,13 +110983,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_HEAL3; - sc_start4 SC_S_LIFEPOTION,600000,-5,5,0,0; + sc_start2 SC_S_LIFEPOTION, 600000, -5, 5; "> }, { @@ -110943,13 +111004,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_HEAL3; - sc_start4 SC_L_LIFEPOTION,600000,-7,4,0,0; + sc_start2 SC_L_LIFEPOTION, 600000, -7, 4; "> }, { @@ -110964,13 +111025,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_MAGICALATTHIT; - sc_start SC_CRITICALPERCENT,300000,30; + sc_start SC_CRITICALPERCENT, 300000, 30; "> }, { @@ -110985,13 +111046,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_LIGHTSPHERE; - sc_start SC_HEALPLUS,1800000,20; + sc_start SC_HEALPLUS, 1800000, 20; "> }, { @@ -111007,13 +111068,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_STEAL; - sc_start SC_PLUSAVOIDVALUE,60000,20; + sc_start SC_PLUSAVOIDVALUE, 60000, 20; "> }, { @@ -111070,13 +111131,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_GUARD; - sc_start SC_PROTECT_DEF,60000,3; + sc_start SC_PROTECT_DEF, 60000, 3; "> }, { @@ -111091,13 +111152,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_GUARD; - sc_start SC_PROTECT_DEF,180000,3; + sc_start SC_PROTECT_DEF, 180000, 3; "> }, { @@ -111112,13 +111173,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_SPELLBREAKER; - sc_start SC_PROTECT_MDEF,60000,3; + sc_start SC_PROTECT_MDEF, 60000, 3; "> }, { @@ -111133,13 +111194,13 @@ item_db: ( notrade: true noselltonpc: true nocart: true - nogstorage: true nomail: true noauction: true + nogstorage: true } Script: <" specialeffect2 EF_SPELLBREAKER; - sc_start SC_PROTECT_MDEF,180000,3; + sc_start SC_PROTECT_MDEF, 180000, 3; "> }, { @@ -112235,7 +112296,7 @@ item_db: ( } Script: <" specialeffect2 EF_SPELLBREAKER; - sc_start SC_TARGET_ASPD,1800000,10; + sc_start SC_TARGET_ASPD, 1800000, 10; "> }, { diff --git a/db/sc_config.txt b/db/sc_config.txt index afc75b8e5..ac65a6677 100644 --- a/db/sc_config.txt +++ b/db/sc_config.txt @@ -388,7 +388,7 @@ SC_MORA_BUFF, 2 //SC_REUSE_LIMIT_H, 29 SC_NEEDLE_OF_PARALYZE, 1 SC_PAIN_KILLER, 1 -//SC_G_LIFEPOTION, 68 +SC_G_LIFEPOTION, 68 //SC_VITALIZE_POTION, 4 SC_LIGHT_OF_REGENE, 1 //SC_SONIC_CLAW_POSTDELAY, 2 @@ -434,6 +434,7 @@ SC_GEFFEN_MAGIC2, 14 SC_GEFFEN_MAGIC3, 14 SC_OVERLAPEXPUP, 12 +SC_M_LIFEPOTION, 68 // Guild Auras should not be saved SC_LEADERSHIP,78 diff --git a/src/map/skill.c b/src/map/skill.c index f82cdee71..f870524fa 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7623,7 +7623,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin // Slim Pitcher case CR_SLIMPITCHER: // Updated to block Slim Pitcher from working on barricades and guardian stones. - if( dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARDIAN_STONE2)) ) + if (dstmd && (dstmd->class_ == MOBID_EMPERIUM || (dstmd->class_ >= MOBID_BARRICADE1 && dstmd->class_ <= MOBID_GUARDIAN_STONE2))) break; if (script->potion_hp || script->potion_sp) { int hp = script->potion_hp, sp = script->potion_sp; diff --git a/src/map/status.c b/src/map/status.c index 108f3d72d..5c2d1d2f5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -859,6 +859,8 @@ void initChangeTables(void) { status->dbs->IconChangeTable[SC_INT_SCROLL] = SI_INT_SCROLL; status->dbs->IconChangeTable[SC_STEAMPACK] = SI_STEAMPACK; status->dbs->IconChangeTable[SC_MAGIC_CANDY] = SI_MAGIC_CANDY; + status->dbs->IconChangeTable[SC_M_LIFEPOTION] = SI_M_LIFEPOTION; + status->dbs->IconChangeTable[SC_G_LIFEPOTION] = SI_G_LIFEPOTION; // Eden Crystal Synthesis status->dbs->IconChangeTable[SC_QUEST_BUFF1] = SI_QUEST_BUFF1; @@ -7751,6 +7753,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t break; case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: + case SC_M_LIFEPOTION: + case SC_G_LIFEPOTION: case SC_CASH_BOSS_ALARM: case SC_STUN: case SC_SLEEP: @@ -8135,12 +8139,14 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t break; case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: - if( val1 == 0 ) return 0; + case SC_M_LIFEPOTION: + case SC_G_LIFEPOTION: + if (val1 == 0) return 0; // val1 = heal percent/amout // val2 = seconds between heals // val4 = total of heals - if( val2 < 1 ) val2 = 1; - if( (val4 = tick/(val2 * 1000)) < 1 ) + if (val2 < 1) val2 = 1; + if ((val4 = tick / (val2 * 1000)) < 1) val4 = 1; tick_time = val2 * 1000; // [GodLesZ] tick time break; @@ -10982,10 +10988,12 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { case SC_S_LIFEPOTION: case SC_L_LIFEPOTION: - if( sd && --(sce->val4) >= 0 ) { + case SC_M_LIFEPOTION: + case SC_G_LIFEPOTION: + if (sd && --(sce->val4) >= 0) { // val1 < 0 = per max% | val1 > 0 = exact amount int hp = 0; - if( st->hp < st->max_hp ) + if (st->hp < st->max_hp) hp = (sce->val1 < 0) ? (int)(sd->status.max_hp * -1 * sce->val1 / 100.) : sce->val1 ; status->heal(bl, hp, 0, 2); sc_timer_next((sce->val2 * 1000) + tick, status->change_timer, bl->id, data); @@ -11600,7 +11608,7 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { break; case SC_MAGIC_CANDY: if (--(sce->val4) > 0) { - status->charge(bl, 0, sce->val3); // Reduce 100 SP every 10 seconds. + status->charge(bl, 0, sce->val3); // Reduce 90 SP every 10 seconds. sc_timer_next(10000 + tick, status->change_timer, bl->id, data); } break; diff --git a/src/map/status.h b/src/map/status.h index dfc914849..b5597dd45 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -822,6 +822,8 @@ typedef enum sc_type { SC_PROMOTE_HEALTH_RESERCH, SC_ENERGY_DRINK_RESERCH, SC_MAGIC_CANDY, + SC_M_LIFEPOTION, + SC_G_LIFEPOTION, // 640 SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; -- cgit v1.2.3-60-g2f50 From e9129d00278edc75a45a1d5d47345c9d9f2460c3 Mon Sep 17 00:00:00 2001 From: Jedzkie Date: Wed, 23 Dec 2015 16:02:13 +0800 Subject: Update: - Rename BLUE_CRYST and PINK_CRYST to BLUE_CRYSTAL and PINK_CRYSTAL - Rename FOOD_STOR to FOOD_STORAGE - Rename TREAS01, TREAS40, TREAS41, TREAS49 to TREASURE_01, TREASURE_40, TREASURE_41, TREASURE_49 --- src/map/battle.c | 10 +++++----- src/map/map.h | 14 +++++++------- src/map/mob.c | 32 ++++++++++++++++---------------- src/map/mob.h | 6 +++--- src/map/pc.c | 13 +++++++------ src/map/skill.c | 39 +++++++++++++++++++-------------------- src/map/status.c | 14 +++++++------- 7 files changed, 64 insertions(+), 64 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/battle.c b/src/map/battle.c index 88037b042..96289fcc8 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3327,16 +3327,16 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam * Calculates BG related damage adjustments. *------------------------------------------*/ // FIXME: flag is undocumented -int64 battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag) -{ - if( !damage ) +int64 battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int64 damage, int div_, uint16 skill_id, uint16 skill_lv, int flag) { + + if (!damage) return 0; nullpo_retr(damage, bl); - if( bl->type == BL_MOB ) { + if (bl->type == BL_MOB) { struct mob_data* md = BL_CAST(BL_MOB, bl); - if( flag&BF_SKILL && (md->class_ == MOBID_BLUE_CRYST || md->class_ == MOBID_PINK_CRYST) ) + if (flag&BF_SKILL && (md->class_ == MOBID_BLUE_CRYSTAL || md->class_ == MOBID_PINK_CRYSTAL)) return 0; // Crystal cannot receive skill damage on battlegrounds } diff --git a/src/map/map.h b/src/map/map.h index db03727f5..dacd81f71 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -66,17 +66,17 @@ enum E_MAPSERVER_ST { // Added definitions for WoESE objects. [L0ne_W0lf] enum MOBID { MOBID_EMPERIUM = 1288, - MOBID_TREAS01 = 1324, - MOBID_TREAS40 = 1363, + MOBID_TREASURE_01 = 1324, + MOBID_TREASURE_40 = 1363, MOBID_BARRICADE1 = 1905, MOBID_BARRICADE2, MOBID_GUARDIAN_STONE1, MOBID_GUARDIAN_STONE2, - MOBID_FOOD_STOR, - MOBID_BLUE_CRYST = 1914, - MOBID_PINK_CRYST, - MOBID_TREAS41 = 1938, - MOBID_TREAS49 = 1946, + MOBID_FOOD_STORAGE, + MOBID_BLUE_CRYSTAL = 1914, + MOBID_PINK_CRYSTAL, + MOBID_TREASURE_41 = 1938, + MOBID_TREASURE_49 = 1946, MOBID_SILVERSNIPER = 2042, MOBID_MAGICDECOY_WIND = 2046, }; diff --git a/src/map/mob.c b/src/map/mob.c index 0d6055b13..d0073d01b 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2741,39 +2741,39 @@ int mob_random_class (int *value, size_t count) /*========================================== * Change mob base class *------------------------------------------*/ -int mob_class_change (struct mob_data *md, int class_) -{ +int mob_class_change (struct mob_data *md, int class_) { + int64 tick = timer->gettick(), c = 0; int i, hp_rate; nullpo_ret(md); - if( md->bl.prev == NULL ) + if (md->bl.prev == NULL) return 0; - //Disable class changing for some targets... + // Disable class changing for some targets... if (md->guardian_data) - return 0; //Guardians/Emperium + return 0; // Guardians/Emperium - if( mob_is_treasure(md) ) - return 0; //Treasure Boxes + if (mob_is_treasure(md)) + return 0; // Treasure Boxes - if( md->special_state.ai > AI_ATTACK ) - return 0; //Marine Spheres and Floras. + if (md->special_state.ai > AI_ATTACK) + return 0; // Marine Spheres and Floras. - if( mob->is_clone(md->class_) ) - return 0; //Clones + if (mob->is_clone(md->class_)) + return 0; // Clones - if( md->class_ == class_ ) - return 0; //Nothing to change. + if (md->class_ == class_) + return 0; // Nothing to change. hp_rate = get_percentage(md->status.hp, md->status.max_hp); md->class_ = class_; md->db = mob->db(class_); - if (battle_config.override_mob_names==1) - memcpy(md->name,md->db->name,NAME_LENGTH); + if (battle_config.override_mob_names == 1) + memcpy(md->name, md->db->name, NAME_LENGTH); else - memcpy(md->name,md->db->jname,NAME_LENGTH); + memcpy(md->name, md->db->jname, NAME_LENGTH); mob_stop_attack(md); mob_stop_walking(md, STOPWALKING_FLAG_NONE); diff --git a/src/map/mob.h b/src/map/mob.h index 6267c0e8c..48b44aab3 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -283,9 +283,9 @@ struct item_drop_list { #define mob_stop_walking(md, type) (unit->stop_walking(&(md)->bl, (type))) #define mob_stop_attack(md) (unit->stop_attack(&(md)->bl)) -#define mob_is_battleground(md) (map->list[(md)->bl.m].flag.battleground && ((md)->class_ == MOBID_BARRICADE2 || ((md)->class_ >= MOBID_FOOD_STOR && (md)->class_ <= MOBID_PINK_CRYST))) -#define mob_is_gvg(md) (map->list[(md)->bl.m].flag.gvg_castle && ( (md)->class_ == MOBID_EMPERIUM || (md)->class_ == MOBID_BARRICADE1 || (md)->class_ == MOBID_GUARIDAN_STONE1 || (md)->class_ == MOBID_GUARIDAN_STONE2)) -#define mob_is_treasure(md) (((md)->class_ >= MOBID_TREAS01 && (md)->class_ <= MOBID_TREAS40) || ((md)->class_ >= MOBID_TREAS41 && (md)->class_ <= MOBID_TREAS49)) +#define mob_is_battleground(md) (map->list[(md)->bl.m].flag.battleground && ((md)->class_ == MOBID_BARRICADE2 || ((md)->class_ >= MOBID_FOOD_STORAGE && (md)->class_ <= MOBID_PINK_CRYSTAL))) +#define mob_is_gvg(md) (map->list[(md)->bl.m].flag.gvg_castle && ( (md)->class_ == MOBID_EMPERIUM || (md)->class_ == MOBID_BARRICADE1 || (md)->class_ == MOBID_GUARDIAN_STONE1 || (md)->class_ == MOBID_GUARDIAN_STONE2)) +#define mob_is_treasure(md) (((md)->class_ >= MOBID_TREASURE_01 && (md)->class_ <= MOBID_TREASURE_40) || ((md)->class_ >= MOBID_TREASURE_41 && (md)->class_ <= MOBID_TREASURE_49)) struct mob_interface { // Dynamic mob database, allows saving of memory when there's big gaps in the mob_db [Skotlex] diff --git a/src/map/pc.c b/src/map/pc.c index 43d320a80..157f7faab 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5246,7 +5246,7 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil sd_status= status->get_status_data(&sd->bl); md_status= status->get_status_data(bl); - if( md->master_id || md_status->mode&MD_BOSS || mob_is_treasure(md) || + if (md->master_id || md_status->mode&MD_BOSS || mob_is_treasure(md) || map->list[bl->m].flag.nomobloot || // check noloot map flag [Lorky] (battle_config.skill_steal_max_tries && //Reached limit of steal attempts. [Lupus] md->state.steal_flag++ >= battle_config.skill_steal_max_tries) @@ -5312,20 +5312,21 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil int pc_steal_coin(struct map_session_data *sd, struct block_list *target) { int rate, skill_lv; struct mob_data *md; - if(!sd || !target || target->type != BL_MOB) + + if (!sd || !target || target->type != BL_MOB) return 0; md = (TBL_MOB*)target; - if( md->state.steal_coin_flag || md->sc.data[SC_STONE] || md->sc.data[SC_FREEZE] || md->status.mode&MD_BOSS ) + if (md->state.steal_coin_flag || md->sc.data[SC_STONE] || md->sc.data[SC_FREEZE] || md->status.mode&MD_BOSS) return 0; - if( mob_is_treasure(md) ) + if (mob_is_treasure(md)) return 0; skill_lv = pc->checkskill(sd, RG_STEALCOIN); - rate = skill_lv*10 + (sd->status.base_level - md->level)*2 + sd->battle_status.dex/2 + sd->battle_status.luk/2; + rate = skill_lv * 10 + (sd->status.base_level - md->level) * 2 + sd->battle_status.dex / 2 + sd->battle_status.luk / 2; if(rnd()%1000 < rate) { - int amount = md->level * skill_lv / 10 + md->level*8 + rnd()%(md->level*2 + 1); // mob_lv * skill_lv / 10 + random [mob_lv*8; mob_lv*10] + int amount = md->level * skill_lv / 10 + md->level * 8 + rnd()%(md->level * 2 + 1); // mob_lv * skill_lv / 10 + random [mob_lv*8; mob_lv*10] pc->getzeny(sd, amount, LOG_TYPE_STEAL, NULL); md->state.steal_coin_flag = 1; diff --git a/src/map/skill.c b/src/map/skill.c index f870524fa..72363b9e3 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5401,19 +5401,18 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin int heal = skill->calc_heal(src, bl, (skill_id == AB_HIGHNESSHEAL)?AL_HEAL:skill_id, (skill_id == AB_HIGHNESSHEAL)?10:skill_lv, true); int heal_get_jobexp; //Highness Heal: starts at 1.7 boost + 0.3 for each level - if( skill_id == AB_HIGHNESSHEAL ) { - heal = heal * ( 17 + 3 * skill_lv ) / 10; + if (skill_id == AB_HIGHNESSHEAL) { + heal = heal * (17 + 3 * skill_lv) / 10; } - if( status->isimmune(bl) || - (dstmd && (dstmd->class_ == MOBID_EMPERIUM || mob_is_battleground(dstmd))) ) - heal=0; + if (status->isimmune(bl) || (dstmd && (dstmd->class_ == MOBID_EMPERIUM || mob_is_battleground(dstmd)))) + heal = 0; - if( sd && dstsd && sd->status.partner_id == dstsd->status.char_id && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.sex == 0 ) - heal = heal*2; + if (sd && dstsd && sd->status.partner_id == dstsd->status.char_id && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.sex == 0) + heal = heal * 2; - if( tsc && tsc->count ) + if (tsc && tsc->count) { - if( tsc->data[SC_KAITE] && !(sstatus->mode&MD_BOSS) ) + if (tsc->data[SC_KAITE] && !(sstatus->mode&MD_BOSS)) { //Bounce back heal if (--tsc->data[SC_KAITE]->val2 <= 0) status_change_end(bl, SC_KAITE, INVALID_TIMER); @@ -7703,9 +7702,9 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin map->freeblock_unlock(); return 0; } - if( rnd() % 100 > skill_lv * 8 || (dstmd && ((dstmd->guardian_data && dstmd->class_ == MOBID_EMPERIUM) || mob_is_battleground(dstmd))) ) { - if( sd ) - clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); + if (rnd() % 100 > skill_lv * 8 || (dstmd && ((dstmd->guardian_data && dstmd->class_ == MOBID_EMPERIUM) || mob_is_battleground(dstmd)))) { + if (sd) + clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); map->freeblock_unlock(); return 0; @@ -11911,24 +11910,24 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 int heal = skill->calc_heal(ss,bl,sg->skill_id,sg->skill_lv,true); struct mob_data *md = BL_CAST(BL_MOB, bl); #ifdef RENEWAL - if( md && md->class_ == MOBID_EMPERIUM ) + if (md && md->class_ == MOBID_EMPERIUM) break; #endif - if( md && mob_is_battleground(md) ) + if (md && mob_is_battleground(md)) break; - if( tstatus->hp >= tstatus->max_hp ) + if (tstatus->hp >= tstatus->max_hp) break; - if( status->isimmune(bl) ) + if (status->isimmune(bl)) heal = 0; clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1); - if( tsc && tsc->data[SC_AKAITSUKI] && heal ) + if (tsc && tsc->data[SC_AKAITSUKI] && heal) heal = ~heal + 1; status->heal(bl, heal, 0, 0); - if( diff >= 500 ) + if (diff >= 500) sg->val1--; } - if( sg->val1 <= 0 ) - skill->del_unitgroup(sg,ALC_MARK); + if (sg->val1 <= 0) + skill->del_unitgroup(sg, ALC_MARK); break; case UNT_EVILLAND: diff --git a/src/map/status.c b/src/map/status.c index 5c2d1d2f5..b154c0283 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -7064,23 +7064,23 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t sc = status->get_sc(bl); st = status->get_status_data(bl); - if( type <= SC_NONE || type >= SC_MAX ) { + if (type <= SC_NONE || type >= SC_MAX) { ShowError("status_change_start: invalid status change (%d)!\n", type); return 0; } - if( !sc ) + if (!sc) return 0; //Unable to receive status changes - if( status->isdead(bl) && type != SC_NOCHAT ) // SC_NOCHAT should work even on dead characters + if (status->isdead(bl) && type != SC_NOCHAT) // SC_NOCHAT should work even on dead characters return 0; - if( bl->type == BL_MOB) { - struct mob_data *md = BL_CAST(BL_MOB,bl); - if(md && (md->class_ == MOBID_EMPERIUM || mob_is_battleground(md)) && type != SC_SAFETYWALL && type != SC_PNEUMA) + if (bl->type == BL_MOB) { + struct mob_data *md = BL_CAST(BL_MOB, bl); + if (md && (md->class_ == MOBID_EMPERIUM || mob_is_battleground(md)) && type != SC_SAFETYWALL && type != SC_PNEUMA) return 0; //Emperium/BG Monsters can't be afflicted by status changes #if 0 - if(md && mob_is_gvg(md) && status->sc2scb_flag(type)&SCB_MAXHP) + if (md && mob_is_gvg(md) && status->sc2scb_flag(type)&SCB_MAXHP) return 0; //prevent status addinh hp to gvg mob (like bloodylust=hp*3 etc... #endif // 0 } -- cgit v1.2.3-60-g2f50