From a70b02e03670755f71e725455c6c587de0fd9b44 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 27 Jan 2013 08:32:25 -0200 Subject: Renaming some more, also temporarily made "display_version" off by default until we decide what to do with the version since it's git. Signed-off-by: shennetsind --- conf/battle/battle.conf | 2 +- conf/battle/battleground.conf | 2 +- conf/battle/client.conf | 6 +++--- conf/battle/drops.conf | 2 +- conf/battle/exp.conf | 2 +- conf/battle/feature.conf | 2 +- conf/battle/gm.conf | 2 +- conf/battle/guild.conf | 2 +- conf/battle/homunc.conf | 2 +- conf/battle/items.conf | 2 +- conf/battle/misc.conf | 2 +- conf/battle/monster.conf | 2 +- conf/battle/party.conf | 4 ++-- conf/battle/pet.conf | 2 +- conf/battle/player.conf | 2 +- conf/battle/skill.conf | 2 +- conf/battle/status.conf | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/battle.conf b/conf/battle/battle.conf index 87ad91597..94f80a2a6 100644 --- a/conf/battle/battle.conf +++ b/conf/battle/battle.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/battleground.conf b/conf/battle/battleground.conf index 98b2dd8db..cce6bd84e 100644 --- a/conf/battle/battleground.conf +++ b/conf/battle/battleground.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/client.conf b/conf/battle/client.conf index 0522e9425..eaf233a5d 100644 --- a/conf/battle/client.conf +++ b/conf/battle/client.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- @@ -105,8 +105,8 @@ summer_ignorepalette: no // Set this to 1 if your clients have langtype problems and can't display motd properly motd_type: 0 -// Show rAthena version to users when the login? -display_version: yes +// Show Hercules version to users when the login? +display_version: no // When affected with the "Hallucination" status effect, send the effect to client? (Note 1) // Note: Set to 'no' if the client lags due to the "Wavy" screen effect. diff --git a/conf/battle/drops.conf b/conf/battle/drops.conf index 104f08467..3704b9a0e 100644 --- a/conf/battle/drops.conf +++ b/conf/battle/drops.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/exp.conf b/conf/battle/exp.conf index fbc7c2967..7c781d3a3 100644 --- a/conf/battle/exp.conf +++ b/conf/battle/exp.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/feature.conf b/conf/battle/feature.conf index fa05efd8b..7e1f83707 100644 --- a/conf/battle/feature.conf +++ b/conf/battle/feature.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Feature Configuration File +// Hercules Feature Configuration File //-------------------------------------------------------------- // Note 1: Value is a config switch (on/off, yes/no or 1/0) // Note 2: Value is in percents (100 means 100%) diff --git a/conf/battle/gm.conf b/conf/battle/gm.conf index e02efa9a8..0120476be 100644 --- a/conf/battle/gm.conf +++ b/conf/battle/gm.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/guild.conf b/conf/battle/guild.conf index 234c73994..3285ccb75 100644 --- a/conf/battle/guild.conf +++ b/conf/battle/guild.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/homunc.conf b/conf/battle/homunc.conf index 6ebd43bec..fb34792ce 100644 --- a/conf/battle/homunc.conf +++ b/conf/battle/homunc.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/items.conf b/conf/battle/items.conf index 7c0ee1ad3..9bc2e37cc 100644 --- a/conf/battle/items.conf +++ b/conf/battle/items.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/misc.conf b/conf/battle/misc.conf index 0105e542b..274cdee23 100644 --- a/conf/battle/misc.conf +++ b/conf/battle/misc.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/monster.conf b/conf/battle/monster.conf index fa9947ec5..51136fbe0 100644 --- a/conf/battle/monster.conf +++ b/conf/battle/monster.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/party.conf b/conf/battle/party.conf index 63fc3a94a..e57bc4fc9 100644 --- a/conf/battle/party.conf +++ b/conf/battle/party.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- @@ -15,7 +15,7 @@ party_update_interval: 1000 // Method used to update party-mate hp-bars: // 0: Aegis - bar is updated every time HP changes (bandwidth intensive) -// 1: rAthena - bar is updated with the party map dots (up to 1 second delay) +// 1: Hercules - bar is updated with the party map dots (up to 1 second delay) party_hp_mode: 0 // When 'Party Share' item sharing is enabled in a party, diff --git a/conf/battle/pet.conf b/conf/battle/pet.conf index de9056972..e80826ce8 100644 --- a/conf/battle/pet.conf +++ b/conf/battle/pet.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/player.conf b/conf/battle/player.conf index 32e3673f7..cacc66e4d 100644 --- a/conf/battle/player.conf +++ b/conf/battle/player.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index 39e1b357a..9006247a2 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- diff --git a/conf/battle/status.conf b/conf/battle/status.conf index 717db68bf..6efe973b7 100644 --- a/conf/battle/status.conf +++ b/conf/battle/status.conf @@ -1,5 +1,5 @@ //-------------------------------------------------------------- -// rAthena Battle Configuration File +// Hercules Battle Configuration File // Originally Translated by Peter Kieser // Made in to plainer English by Ancyker //-------------------------------------------------------------- -- cgit v1.2.3-70-g09d2 From cba3bef47e8758ab1db43bd5ee3b6fcc5f9a498b Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 28 Jan 2013 18:42:25 -0200 Subject: New skill config After due consideration we thought it'd be in the best interest of the community to provide a switch to this official feature since it drastically change the way traps can be used Signed-off-by: shennetsind --- conf/battle/skill.conf | 5 +++++ src/map/battle.c | 4 ++++ src/map/battle.h | 1 + src/map/skill.c | 2 +- src/map/status.c | 4 ++++ src/map/unit.c | 6 +++++- 6 files changed, 20 insertions(+), 2 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index 9006247a2..03aae2ad1 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -275,3 +275,8 @@ invincible.nodamage: no // On official server, a fix is in place that prevents the switching of weapons to cancel songs. // Default: yes dancing_weaponswitch_fix: yes + +// Skill Trap Type +// 0: (official) traps only makes player unable to move after its walk path is complete, and it activates other traps on the way. +// 1: trap makes player stops moving right when stepping over it. +skill_trap_type: 0 diff --git a/src/map/battle.c b/src/map/battle.c index d04eb1aa8..24aa335af 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5864,6 +5864,10 @@ static const struct _battle_data { { "homunculus_max_level", &battle_config.hom_max_level, 99, 0, MAX_LEVEL, }, { "homunculus_S_max_level", &battle_config.hom_S_max_level, 150, 0, MAX_LEVEL, }, { "mob_size_influence", &battle_config.mob_size_influence, 0, 0, 1, }, + /** + * Hercules + **/ + { "skill_trap_type", &battle_config.skill_trap_type, 0, 0, 1, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index 1c1b1d38c..0943b1aa3 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -483,6 +483,7 @@ extern struct Battle_Config int atcommand_mobinfo_type; int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95] + int skill_trap_type; } battle_config; void do_init_battle(void); diff --git a/src/map/skill.c b/src/map/skill.c index 5f3036565..06982bea7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -11445,7 +11445,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns const struct TimerData* td = tsc->data[type]?get_timer(tsc->data[type]->timer):NULL; if( td ) sec = DIFF_TICK(td->tick, tick); - if( sg->unit_id == UNT_MANHOLE ) { + if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type ) { unit_movepos(bl, src->bl.x, src->bl.y, 0, 0); clif_fixpos(bl); } diff --git a/src/map/status.c b/src/map/status.c index 8167e9949..0379d05d2 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -8646,6 +8646,10 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val case SC_PARALYSIS: unit_stop_walking(bl,1); break; + case SC_ANKLE: + if( battle_config.skill_trap_type ) + unit_stop_walking(bl,1); + break; case SC_HIDING: case SC_CLOAKING: case SC_CLOAKINGEXCEED: diff --git a/src/map/unit.c b/src/map/unit.c index 5d2a6c794..148a35782 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -350,6 +350,8 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag) map_random_dir(bl, &ud->to_x, &ud->to_y); if(ud->walktimer != INVALID_TIMER) { + if( !battle_config.skill_trap_type && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path + return 0; // When you come to the center of the grid because the change of destination while you're walking right now // Call a function from a timer unit_walktoxy_sub ud->state.change_walk_target = 1; @@ -425,6 +427,8 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int map_random_dir(bl, &ud->to_x, &ud->to_y); if(ud->walktimer != INVALID_TIMER) { + if( !battle_config.skill_trap_type && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path + return 0; ud->state.change_walk_target = 1; set_mobstate(bl, flag&2); return 1; @@ -931,7 +935,7 @@ int unit_can_move(struct block_list *bl) { ) return 0; - if( sc->data[SC_ANKLE] && !unit_is_walking(bl) ) // Ankle only stops you after you're done moving + if( sc->data[SC_ANKLE] && ( battle_config.skill_trap_type || !unit_is_walking(bl) ) ) // Ankle only stops you after you're done moving return 0; if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING && (sc->opt1 != OPT1_CRYSTALIZE && bl->type != BL_MOB)) -- cgit v1.2.3-70-g09d2 From 620b36de1890e39ce662245567ac8e60b5cc8990 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 30 Jan 2013 19:40:36 -0200 Subject: Fixing a typo on skill_trap_type description Signed-off-by: shennetsind --- conf/battle/skill.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conf/battle') diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index 03aae2ad1..0dd97610e 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -278,5 +278,5 @@ dancing_weaponswitch_fix: yes // Skill Trap Type // 0: (official) traps only makes player unable to move after its walk path is complete, and it activates other traps on the way. -// 1: trap makes player stops moving right when stepping over it. +// 1: trap makes player stop moving right when stepping over it. skill_trap_type: 0 -- cgit v1.2.3-70-g09d2 From cc8e005f27f3be0d7bcf8916cb40b2dd0e6a3ae1 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 3 Feb 2013 18:31:21 -0200 Subject: item_noequip overhaul / Fixed Bug #7048 Items are no longer unequipped when disabled by item_noequip.txt, instead their effects are nullified -- however cards in them, unless also disabled, wont have its effect nullified. Consumables will be consumed even while disabled, unless you modify the new config item_restricted_consumption_type http://hercules.ws/board/tracker/issue-7048-requestreport-regarding-to-item-noequiptxt/ Signed-off-by: shennetsind --- conf/battle/items.conf | 5 +++++ src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/pc.c | 55 +++++++++++++++----------------------------------- src/map/status.c | 14 +++++++++++++ 5 files changed, 37 insertions(+), 39 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/items.conf b/conf/battle/items.conf index 9bc2e37cc..343b4212e 100644 --- a/conf/battle/items.conf +++ b/conf/battle/items.conf @@ -75,3 +75,8 @@ gtb_sc_immunity: 50 // NOTE: Different cards that grant the same skill will both // always work independently of each other regardless of setting. autospell_stacking: no + +// Will disabled consumables (disabled by item_noequip.txt) be consumed when trying to use them? +// 1 (official): yes +// 0: no +item_restricted_consumption_type:1 \ No newline at end of file diff --git a/src/map/battle.c b/src/map/battle.c index 4505b6a63..0506f2fe9 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5867,6 +5867,7 @@ static const struct _battle_data { * Hercules **/ { "skill_trap_type", &battle_config.skill_trap_type, 0, 0, 1, }, + { "item_restricted_consumption_type", &battle_config.item_restricted_consumption_type,1, 0, 1, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index 0943b1aa3..c5ca19b90 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -484,6 +484,7 @@ extern struct Battle_Config int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95] int skill_trap_type; + int item_restricted_consumption_type; } battle_config; void do_init_battle(void); diff --git a/src/map/pc.c b/src/map/pc.c index 49b905c0d..6f608cd49 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -861,20 +861,6 @@ int pc_isequip(struct map_session_data *sd,int n) #endif if(item->sex != 2 && sd->status.sex != item->sex) return 0; - if(!map_flag_vs(sd->bl.m) && ((item->flag.no_equip&1))) - return 0; - if(map[sd->bl.m].flag.pvp && ((item->flag.no_equip&2))) - return 0; - if(map_flag_gvg(sd->bl.m) && ((item->flag.no_equip&4))) - return 0; - if(map[sd->bl.m].flag.battleground && ((item->flag.no_equip&8))) - return 0; - if(map[sd->bl.m].flag.restricted) - { - int flag =8*map[sd->bl.m].zone; - if (item->flag.no_equip&flag) - return 0; - } if (sd->sc.count) { @@ -4134,16 +4120,6 @@ int pc_isUseitem(struct map_session_data *sd,int n) else if( itemdb_is_poison(nameid) && (sd->class_&MAPID_THIRDMASK) != MAPID_GUILLOTINE_CROSS ) return 0; - //added item_noequip.txt items check by Maya&[Lupus] - if ( - (!map_flag_vs(sd->bl.m) && item->flag.no_equip&1) || // Normal - (map[sd->bl.m].flag.pvp && item->flag.no_equip&2) || // PVP - (map_flag_gvg(sd->bl.m) && item->flag.no_equip&4) || // GVG - (map[sd->bl.m].flag.battleground && item->flag.no_equip&8) || // Battleground - (map[sd->bl.m].flag.restricted && item->flag.no_equip&(8*map[sd->bl.m].zone)) // Zone restriction - ) - return 0; - //Gender check if(item->sex != 2 && sd->status.sex != item->sex) return 0; @@ -4222,7 +4198,7 @@ int pc_useitem(struct map_session_data *sd,int n) (itemdb_iscashfood(nameid) && DIFF_TICK(sd->canusecashfood_tick, tick) > 0) ) return 0; - + /* Items with delayed consume are not meant to work while in mounts except reins of mount(12622) */ if( sd->inventory_data[n]->flag.delay_consume ) { if( nameid != ITEMID_REINS_OF_MOUNT && sd->sc.option&OPTION_MOUNTING ) @@ -4273,6 +4249,21 @@ int pc_useitem(struct map_session_data *sd,int n) } } + /* on restricted maps the item is consumed but the effect is not used */ + if ( + (!map_flag_vs(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&1) || // Normal + (map[sd->bl.m].flag.pvp && sd->inventory_data[n]->flag.no_equip&2) || // PVP + (map_flag_gvg(sd->bl.m) && sd->inventory_data[n]->flag.no_equip&4) || // GVG + (map[sd->bl.m].flag.battleground && sd->inventory_data[n]->flag.no_equip&8) || // Battleground + (map[sd->bl.m].flag.restricted && sd->inventory_data[n]->flag.no_equip&(8*map[sd->bl.m].zone)) // Zone restriction + ) { + if( battle_config.item_restricted_consumption_type ) { + clif_useitemack(sd,n,sd->status.inventory[n].amount-1,true); + pc_delitem(sd,n,1,1,0,LOG_TYPE_CONSUME); + } + return 0;/* regardless, effect is not run */ + } + sd->itemid = sd->status.inventory[n].nameid; sd->itemindex = n; if(sd->catch_target_class != -1) //Abort pet catching. @@ -8612,7 +8603,6 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) { int pc_checkitem(struct map_session_data *sd) { int i,id,calc_flag = 0; - struct item_data *it=NULL; nullpo_ret(sd); @@ -8640,7 +8630,6 @@ int pc_checkitem(struct map_session_data *sd) } for( i = 0; i < MAX_INVENTORY; i++) { - it = sd->inventory_data[i]; if( sd->status.inventory[i].nameid == 0 ) continue; @@ -8654,18 +8643,6 @@ int pc_checkitem(struct map_session_data *sd) continue; } - if( it ) { // check for forbiden items. - int flag = - (map[sd->bl.m].flag.restricted?(8*map[sd->bl.m].zone):0) - | (!map_flag_vs(sd->bl.m)?1:0) - | (map[sd->bl.m].flag.pvp?2:0) - | (map_flag_gvg(sd->bl.m)?4:0) - | (map[sd->bl.m].flag.battleground?8:0); - if( flag && (it->flag.no_equip&flag) ) { - pc_unequipitem(sd, i, 2); - calc_flag = 1; - } - } } if( calc_flag && sd->state.active ) { diff --git a/src/map/status.c b/src/map/status.c index ce792cd75..7840a7a7f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2443,6 +2443,20 @@ int status_calc_pc_(struct map_session_data* sd, bool first) if(!sd->inventory_data[index]) continue; + if(sd->inventory_data[index]->flag.no_equip) { // Items may be equipped, their effects however are nullified. + if(map[sd->bl.m].flag.restricted && sd->inventory_data[index]->flag.no_equip&(8*map[sd->bl.m].zone)) + continue; + if(!map_flag_vs(sd->bl.m) && sd->inventory_data[index]->flag.no_equip&1) + continue; + if(map[sd->bl.m].flag.pvp && sd->inventory_data[index]->flag.no_equip&2) + continue; + if(map_flag_gvg(sd->bl.m) && sd->inventory_data[index]->flag.no_equip&4) + continue; + if(map[sd->bl.m].flag.battleground && sd->inventory_data[index]->flag.no_equip&8) + continue; + } + + status->def += sd->inventory_data[index]->def; if(first && sd->inventory_data[index]->equip_script) -- cgit v1.2.3-70-g09d2 From c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158 Mon Sep 17 00:00:00 2001 From: malufett Date: Tue, 5 Feb 2013 19:12:39 +0800 Subject: Fix Bug # 7049 Added new item bonuses bFixedCast, bVariableCast & bFixedCastrate. (see 'doc/item_bonus.txt' for info) Added new conf for max walk path.(Bug Report # 7042) http://hercules.ws/board/tracker/issue-7049-do-we-need-new-bonus/?gopid=16578#entry16578 --- conf/battle/client.conf | 4 ++++ db/const.txt | 3 +++ doc/item_bonus.txt | 7 +++++-- src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/map.h | 2 +- src/map/pc.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- src/map/pc.h | 3 ++- src/map/script.c | 1 + src/map/skill.c | 10 ++++++++++ src/map/status.c | 3 ++- src/map/unit.c | 7 ++++--- 12 files changed, 78 insertions(+), 9 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/client.conf b/conf/battle/client.conf index eaf233a5d..17a10dde5 100644 --- a/conf/battle/client.conf +++ b/conf/battle/client.conf @@ -61,6 +61,10 @@ pet_hair_style: 100 // Visible area size (how many squares away from a player can they see) area_size: 14 +// Maximum walk path (how many cells a player can walk going to cursor) +// default: 17(official) +max_walk_path: 17 + // Maximum allowed 'level' value that can be sent in unit packets. // Use together with the aura_lv setting to tell when exactly to show the aura. // NOTE: You also need to adjust the client if you want this to work. diff --git a/db/const.txt b/db/const.txt index 09b1c64c7..b4fa39366 100644 --- a/db/const.txt +++ b/db/const.txt @@ -588,6 +588,9 @@ bFixedCastrate 2053 bVariableCastrate 2054 bSkillUseSP 2055 bMagicAtkEle 2056 +bFixedCast 2057 + +bVariableCast 2058 EQI_HEAD_TOP 1 EQI_ARMOR 2 diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt index e331dbf7b..559e49414 100644 --- a/doc/item_bonus.txt +++ b/doc/item_bonus.txt @@ -409,8 +409,11 @@ bonus2 bSkillUseSPrate,s,x; Reduces SP consumption of skill s by x%. (supports bonus2 bSkillUseSP,s,x; Reduces SP consumption of skill s by x. (supports skill names.) bonus2 bSkillCooldown,s,x; Increases cooldown of skill s by x milliseconds. (supports skill names.) -bonus bFixedCastrate,x; Increases fixed cast time of skills by x%. -bonus bVariableCastrate,x; Increases variable cast time of skills by x%. +bonus bFixedCastrate,x; Increases fixed cast time of all skills by x%. +bonus bVariableCastrate,x; Increases variable cast time of all skills by x%. +bonus bFixedCast,x; Increases fixed cast time of all skills by x milliseconds; +bonus bVariableCast,x; Increases variable cast time of all skills by x milliseconds; bonus2 bSkillFixedCast,s,x; Increases fixed cast time of skill s by x milliseconds. (supports skill names.) bonus2 bSkillVariableCast,s,x; Increases variable cast time of skill s by x milliseconds. (supports skill names.) bonus2 bVariableCastrate,s,x; Increases variable cast time of skill s by x%. (supports skill names.) +bonus2 bFixedCastrate,s,x; Increases fixed cast time of skill s by x%. (supports skill names.) \ No newline at end of file diff --git a/src/map/battle.c b/src/map/battle.c index 0506f2fe9..f9748833f 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5868,6 +5868,7 @@ static const struct _battle_data { **/ { "skill_trap_type", &battle_config.skill_trap_type, 0, 0, 1, }, { "item_restricted_consumption_type", &battle_config.item_restricted_consumption_type,1, 0, 1, }, + { "max_walk_path", &battle_config.max_walk_path, 17, 1, MAX_WALKPATH, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index c5ca19b90..6586f4561 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -485,6 +485,7 @@ extern struct Battle_Config int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95] int skill_trap_type; int item_restricted_consumption_type; + int max_walk_path; } battle_config; void do_init_battle(void); diff --git a/src/map/map.h b/src/map/map.h index 86d936972..bb0bccf2c 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -406,7 +406,7 @@ enum _sp { SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE, SP_MAGIC_SP_GAIN_VALUE, SP_MAGIC_HP_GAIN_VALUE, SP_ADD_CLASS_DROP_ITEM, //2041-2045 SP_EMATK, SP_SP_GAIN_RACE_ATTACK, SP_HP_GAIN_RACE_ATTACK, SP_SKILL_USE_SP_RATE, //2046-2049 SP_SKILL_COOLDOWN,SP_SKILL_FIXEDCAST, SP_SKILL_VARIABLECAST, SP_FIXCASTRATE, SP_VARCASTRATE, //2050-2054 - SP_SKILL_USE_SP,SP_MAGIC_ATK_ELE //2055-2056 + SP_SKILL_USE_SP,SP_MAGIC_ATK_ELE, SP_ADD_FIXEDCAST, SP_ADD_VARIABLECAST //2055-2058 }; enum _look { diff --git a/src/map/pc.c b/src/map/pc.c index 4fb555d0f..6e24d7d49 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2591,11 +2591,22 @@ int pc_bonus(struct map_session_data *sd,int type,int val) if(sd->state.lr_flag != 2) sd->bonus.fixcastrate -= val; break; + case SP_ADD_FIXEDCAST: + if(sd->state.lr_flag != 2) + sd->bonus.add_fixcast += val; + + break; #ifdef RENEWAL_CAST case SP_VARCASTRATE: if(sd->state.lr_flag != 2) sd->bonus.varcastrate -= val; break; + case SP_ADD_VARIABLECAST: + if(sd->state.lr_flag != 2) + + sd->bonus.add_varcast += val; + + break; #endif default: ShowWarning("pc_bonus: unknown type %d %d !\n",type,val); @@ -2953,7 +2964,15 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) ARR_FIND(0, ARRAYLENGTH(sd->skillcast), i, sd->skillcast[i].id == 0 || sd->skillcast[i].id == type2); if (i == ARRAYLENGTH(sd->skillcast)) { //Better mention this so the array length can be updated. [Skotlex] - ShowDebug("run_script: bonus2 bCastRate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillcast), type2, val); + ShowDebug("run_script: bonus2 %s reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", + +#ifndef RENEWAL_CAST + "bCastRate", +#else + "bVariableCastrate", +#endif + + ARRAYLENGTH(sd->skillcast), type2, val); break; } if(sd->skillcast[i].id == type2) @@ -2964,6 +2983,30 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) } break; + case SP_FIXCASTRATE: + if(sd->state.lr_flag == 2) + break; + + ARR_FIND(0, ARRAYLENGTH(sd->skillfixcastrate), i, sd->skillfixcastrate[i].id == 0 || sd->skillfixcastrate[i].id == type2); + + if (i == ARRAYLENGTH(sd->skillfixcastrate)) + + { + + ShowDebug("run_script: bonus2 bFixedCastrate reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n", ARRAYLENGTH(sd->skillfixcastrate), type2, val); + break; + } + + if(sd->skillfixcastrate[i].id == type2) + sd->skillfixcastrate[i].val += val; + + else { + sd->skillfixcastrate[i].id = type2; + sd->skillfixcastrate[i].val = val; + } + + break; + case SP_HP_LOSS_RATE: if(sd->state.lr_flag != 2) { sd->hp_loss.value = type2; diff --git a/src/map/pc.h b/src/map/pc.h index 870945d73..ac1950a69 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -263,7 +263,7 @@ struct map_session_data { struct { //skillatk raises bonus dmg% of skills, skillheal increases heal%, skillblown increases bonus blewcount for some skills. unsigned short id; short val; - } skillatk[MAX_PC_BONUS], skillusesprate[MAX_PC_BONUS], skillusesp[MAX_PC_BONUS], skillheal[5], skillheal2[5], skillblown[MAX_PC_BONUS], skillcast[MAX_PC_BONUS], skillcooldown[MAX_PC_BONUS], skillfixcast[MAX_PC_BONUS], skillvarcast[MAX_PC_BONUS]; + } skillatk[MAX_PC_BONUS], skillusesprate[MAX_PC_BONUS], skillusesp[MAX_PC_BONUS], skillheal[5], skillheal2[5], skillblown[MAX_PC_BONUS], skillcast[MAX_PC_BONUS], skillcooldown[MAX_PC_BONUS], skillfixcast[MAX_PC_BONUS], skillvarcast[MAX_PC_BONUS], skillfixcastrate[MAX_PC_BONUS]; struct { short value; int rate; @@ -320,6 +320,7 @@ struct map_session_data { unsigned short unbreakable_equip; //100% break resistance on certain equipment unsigned short unstripable_equip; int fixcastrate,varcastrate; + int add_fixcast,add_varcast; int ematk; // matk bonus from equipment // int eatk; // atk bonus from equipment } bonus; diff --git a/src/map/script.c b/src/map/script.c index 60a61654a..0b649f990 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7860,6 +7860,7 @@ BUILDIN_FUNC(bonus) case SP_SKILL_FIXEDCAST: case SP_SKILL_VARIABLECAST: case SP_VARCASTRATE: + case SP_FIXCASTRATE: case SP_SKILL_USE_SP: // these bonuses support skill names val1 = ( script_isstring(st,3) ? skill_name2id(script_getstr(st,3)) : script_getnum(st,3) ); diff --git a/src/map/skill.c b/src/map/skill.c index 9c07390f3..2cc3ed1ab 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -13819,6 +13819,10 @@ int skill_vfcastfix (struct block_list *bl, double time, uint16 skill_id, uint16 if(sd && !(skill_get_castnodex(skill_id, skill_lv)&4) ){ // Increases/Decreases fixed/variable cast time of a skill by item/card bonuses. if( sd->bonus.varcastrate < 0 ) VARCAST_REDUCTION(sd->bonus.varcastrate); + if( sd->bonus.add_varcast != 0 ) // bonus bVariableCast + time += sd->bonus.add_varcast; + if( sd->bonus.add_fixcast != 0 ) // bonus bFixedCast + fixed += sd->bonus.add_fixcast; for (i = 0; i < ARRAYLENGTH(sd->skillfixcast) && sd->skillfixcast[i].id; i++) if (sd->skillfixcast[i].id == skill_id){ // bonus2 bSkillFixedCast fixed += sd->skillfixcast[i].val; @@ -13835,6 +13839,12 @@ int skill_vfcastfix (struct block_list *bl, double time, uint16 skill_id, uint16 VARCAST_REDUCTION(i); break; } + for( i = 0; i < ARRAYLENGTH(sd->skillfixcastrate) && sd->skillfixcastrate[i].id; i++ ) + + if( sd->skillfixcastrate[i].id == skill_id ){ // bonus2 bFixedCastrate + fixcast_r = sd->skillfixcastrate[i].val; // just speculation + break; + } } if (sc && sc->count && !(skill_get_castnodex(skill_id, skill_lv)&2) ) { diff --git a/src/map/status.c b/src/map/status.c index 7840a7a7f..8fd48aefc 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1,4 +1,4 @@ -// Copyright (c) Hercules dev team, licensed under GNU GPL. +// Copyright (c) Hercules dev team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena dev team @@ -2416,6 +2416,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first) + sizeof(sd->skillcooldown) + sizeof(sd->skillfixcast) + sizeof(sd->skillvarcast) + + sizeof(sd->skillfixcastrate) ); memset (&sd->bonus, 0,sizeof(sd->bonus)); diff --git a/src/map/unit.c b/src/map/unit.c index e901d3138..fca406e5f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -315,21 +315,22 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag) { struct unit_data* ud = NULL; struct status_change* sc = NULL; -#ifdef OFFICIAL_WALKPATH struct walkpath_data wpd; -#endif + nullpo_ret(bl); ud = unit_bl2ud(bl); if( ud == NULL) return 0; -#ifdef OFFICIAL_WALKPATH path_search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS); // Count walk path cells +#ifdef OFFICIAL_WALKPATH if( !path_search_long(NULL, bl->m, bl->x, bl->y, x, y, CELL_CHKNOPASS) // Check if there is an obstacle between && wpd.path_len > 14 ) // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett] return 0; #endif + if( battle_config.max_walk_path < wpd.path_len ) + return 0; if (flag&4 && DIFF_TICK(ud->canmove_tick, gettick()) > 0 && DIFF_TICK(ud->canmove_tick, gettick()) < 2000) -- cgit v1.2.3-70-g09d2 From 4c9bfed8c21cb80a806fffc32c7ac629bdf73438 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 7 Feb 2013 22:15:52 -0200 Subject: Adjustment to skill_trap_type battle/skill config The effect of the config is now restricted to GvG. http://hercules.ws/board/tracker/issue-4832-hunter-ht-anklesnare-serious-bug/ Signed-off-by: shennetsind --- conf/battle/skill.conf | 6 +++--- src/map/skill.c | 2 +- src/map/status.c | 2 +- src/map/unit.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index 0dd97610e..ecb2dd00a 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -276,7 +276,7 @@ invincible.nodamage: no // Default: yes dancing_weaponswitch_fix: yes -// Skill Trap Type -// 0: (official) traps only makes player unable to move after its walk path is complete, and it activates other traps on the way. -// 1: trap makes player stop moving right when stepping over it. +// Skill Trap Type (GvG) +// 0: (official) traps in GvG only makes player unable to move after its walk path is complete, and it activates other traps on the way. +// 1: trap in GvG makes player stop moving right when stepping over it. skill_trap_type: 0 diff --git a/src/map/skill.c b/src/map/skill.c index 4b9484609..cb15f0083 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -11459,7 +11459,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns const struct TimerData* td = tsc->data[type]?get_timer(tsc->data[type]->timer):NULL; if( td ) sec = DIFF_TICK(td->tick, tick); - if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type ) { + if( sg->unit_id == UNT_MANHOLE || battle_config.skill_trap_type || !map_flag_gvg(src->bl.m) ) { unit_movepos(bl, src->bl.x, src->bl.y, 0, 0); clif_fixpos(bl); } diff --git a/src/map/status.c b/src/map/status.c index 0ee993de4..97b7c61a1 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -8663,7 +8663,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val unit_stop_walking(bl,1); break; case SC_ANKLE: - if( battle_config.skill_trap_type ) + if( battle_config.skill_trap_type || !map_flag_gvg(bl->m) ) unit_stop_walking(bl,1); break; case SC_HIDING: diff --git a/src/map/unit.c b/src/map/unit.c index 1d37704e0..60de14093 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -353,7 +353,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag) map_random_dir(bl, &ud->to_x, &ud->to_y); if(ud->walktimer != INVALID_TIMER) { - if( !battle_config.skill_trap_type && sc && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path + if( !battle_config.skill_trap_type && sc && map_flag_gvg(bl->m) && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path return 0; // When you come to the center of the grid because the change of destination while you're walking right now // Call a function from a timer unit_walktoxy_sub @@ -430,7 +430,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int map_random_dir(bl, &ud->to_x, &ud->to_y); if(ud->walktimer != INVALID_TIMER) { - if( !battle_config.skill_trap_type && sc && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path + if( !battle_config.skill_trap_type && sc && map_flag_gvg(bl->m) && sc->data[SC_ANKLE] ) // Ankle disallows you from changing your path return 0; ud->state.change_walk_target = 1; set_mobstate(bl, flag&2); @@ -938,7 +938,7 @@ int unit_can_move(struct block_list *bl) { ) return 0; - if( sc->data[SC_ANKLE] && ( battle_config.skill_trap_type || !unit_is_walking(bl) ) ) // Ankle only stops you after you're done moving + if( sc->data[SC_ANKLE] && ( battle_config.skill_trap_type || ( !map_flag_gvg(bl->m) && !unit_is_walking(bl) ) ) ) // Ankle only stops you after you're done moving return 0; if (sc->opt1 > 0 && sc->opt1 != OPT1_STONEWAIT && sc->opt1 != OPT1_BURNING && !(sc->opt1 == OPT1_CRYSTALIZE && bl->type == BL_MOB)) -- cgit v1.2.3-70-g09d2 From 56a20bb18d6fde61bb82cf160a131eb54d464148 Mon Sep 17 00:00:00 2001 From: Mysteries Date: Sun, 10 Feb 2013 22:22:23 -0500 Subject: Merged rAthena Changes - Added checkidle() command that was present in rAthena since r17126 - Documented checkidle() function - More clearly defined variables in eA Job System documentation - Added missing 'stopnpctimer' in custom Cluckers script --- conf/battle/skill.conf | 6 +++--- doc/ea_job_system.txt | 30 +++++++++++++++++------------- doc/script_commands.txt | 9 ++++++++- npc/custom/events/cluckers.txt | 7 +++---- src/map/script.c | 18 ++++++++++++++++++ 5 files changed, 49 insertions(+), 21 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf index ecb2dd00a..622ce7877 100644 --- a/conf/battle/skill.conf +++ b/conf/battle/skill.conf @@ -277,6 +277,6 @@ invincible.nodamage: no dancing_weaponswitch_fix: yes // Skill Trap Type (GvG) -// 0: (official) traps in GvG only makes player unable to move after its walk path is complete, and it activates other traps on the way. -// 1: trap in GvG makes player stop moving right when stepping over it. -skill_trap_type: 0 +// 0: (official) Traps in GvG only make player stop moving after its walk path is complete, and it activates other traps on the way. +// 1: Traps in GvG make player stop moving right when stepping over it. +skill_trap_type: 0 \ No newline at end of file diff --git a/doc/ea_job_system.txt b/doc/ea_job_system.txt index e25f10689..034b4a617 100644 --- a/doc/ea_job_system.txt +++ b/doc/ea_job_system.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= Skotlex //===== Current Version: ===================================== -//= 20120610 +//= 2013-02-10 //===== Description: ========================================= //= A reference description of eA's inner job system (for use //= in scripts through the eaclass and roclass script commands). @@ -19,7 +19,7 @@ Preface: The eA Job System: ------------------------------------------------------------------------------- - Since the code also required to do this kind of checks for various skills (The Soul Linker Spirit buffs specially come to mind), an alternate job ID system was developed, which attempts to make more sense and make it easier to check where a particular job stands in relation to the rest. + Since the code also required to do this kind of checks for various skills (the Soul Linker Spirit buffs specifically come to mind), an alternate job ID system was developed, which attempts to make more sense and make it easier to check where a particular job stands in relation to the rest. The scheme consists in that every job can be broken down by 3 criteria: @@ -84,53 +84,57 @@ If we had used addition, we would have gotten a completely different result. The EAJL (eA Job Level) constants ------------------------------------------------------------------------------- - There are a few constants which can be used to filter out and make job comparisons easier. + There are a few constants which can be used to filter out and make job comparisons easier. The comparisons involve eA job IDs, not classic job IDs, using the eaclass() command explained in the next section. + + set @eac, eaclass(); EAJL_2_1: Checks if the class is a 2-1 class: - if (@job&EAJL_2_1) + if (@eac&EAJL_2_1) mes "Using the classic 2-1 job, huh?"; EAJL_2_2: - Checks if the class is 2-2. + Checks if the class is a 2-2 class: + if (@eac&EAJL_2_2) + mes "Oh, a 2-2 job!"; EAJL_2: Checks if the class is a 2nd Class. If the check fails, you can be sure the character is a first class. - if (!(@job&EAJL_2)) + if (!(@eac&EAJL_2)) mes "Will you wait until Job 50 to change?"; EAJL_UPPER: Check if a class is Rebirth/Advanced: - if(@job&EAJL_UPPER) + if(@eac&EAJL_UPPER) mes "It must have taken you a LONG time..."; EAJL_BABY: Check if a class is an adopted class. - if (@job&EAJL_BABY) + if (@eac&EAJL_BABY) mes "Don't you hate being weak?"; EAJL_THIRD: Checks if a class is a third job. - if(@job&EAJL_THIRD) + if(@eac&EAJL_THIRD) mes "Wow, you've really grown!"; EAJ_UPPERMASK: The upper mask can be used to "strip" the upper/baby characteristics of a class, used when you want to know if someone is a certain class regardless of rebirth/adopted status. For example, the following code would go through for Monks, Champions and Baby Monks: - if ((@job&EAJ_UPPERMASK) == EAJ_MONK) + if ((@eac&EAJ_UPPERMASK) == EAJ_MONK) mes "Aren't knuckles such a cool weapon?"; Note that if instead of EAJ_MONK you used EAJ_CHAMPION or EAJ_BABY_MONK, the check would had never passed, since the upper/baby state has been removed from the original job when checking. EAJ_BASEMASK: This mask strips also the 2nd class attributes. It can be used to check against the basic job of a character. For example, the following code would go through for Merchants (+Baby Merchant and High Merchant), Blacksmiths (+Baby blacksmiths and Whitesmith) and Alchemist (+Baby Alchemist and +Creator): - if ((@job&EAJ_BASEMASK) == EAJ_MERCHANT) + if ((@eac&EAJ_BASEMASK) == EAJ_MERCHANT) mes "Why I can't have discount like you guys do?"; Note that, like before, if you try to check versus any of the other classes (High merchant, blacksmith, etc) instead of basic merchant, the check will always fail for the same reasons previously explained. EAJ_THIRDMASK: This mask strips 3rd class attributes. It will give the "normal" class of a third job, regardless of rebirth/adopted status. When used on non-third class characters, it will return the second job, or, if that also doesn't exist, the first. - if ((@job&EAJ_THIRDMASK) == EAJ_WARLOCK_T) + if ((@eac&EAJ_THIRDMASK) == EAJ_WARLOCK_T) mes "You've gone through rebirth, I see."; The script commands eaclass, roclass: @@ -189,5 +193,5 @@ About Novices and Super Novices: So as you can see, on this job system, the Super Novice is treated as the 2-1 job of a Novice, and the Novice job it's at the same level of the other 1st jobs. Even though that may seem like a hindrance, it makes it very easy to add a check to discard Novice types from a quest: - if ((@job&EAJ_BASEMASK) == EAJ_NOVICE) + if ((eaclass()&EAJ_BASEMASK) == EAJ_NOVICE) //Novice class detected. diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 3c93490bb..cd08e618c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -3545,7 +3545,7 @@ warg and 0 if they don't. --------------------------------------- -*checkvending({""}) +*checkvending({""}) *checkchatting({""}) Checks if the player is vending or in a chatroom. @@ -3570,6 +3570,13 @@ Examples: --------------------------------------- +*checkidle({""}) + + Returns the time, in seconds, that the specified player has been idle. + Name is optional, and defaults to the attached player if omitted. + +--------------------------------------- + *agitcheck() *agitcheck2() diff --git a/npc/custom/events/cluckers.txt b/npc/custom/events/cluckers.txt index bc9899488..cf296cb18 100644 --- a/npc/custom/events/cluckers.txt +++ b/npc/custom/events/cluckers.txt @@ -1,11 +1,9 @@ -//===== rAthena Script ======================================= +//===== Hercules Script ======================================= //= Cluck! Cluck! Boom! //===== By: ================================================== //= Keale //===== Current Version: ===================================== //= 1.2a -//===== Compatible With: ===================================== -//= rAthena SVN //===== Description: ========================================= //= Click the chicken and try retrieve the item at a low //= chance. If you fail he will nuke, freeze, stone, @@ -108,8 +106,9 @@ OnTimer30000: end; OnTimer40000: announce "GO! Click the chicken to get the prize!",bc_blue; + stopnpctimer; if (!$cluck_item_id) set $cluck_item_id,512; if (!$cluck_item_amount) set $cluck_item_amount,1; set .startcluck,1; end; -} +} \ No newline at end of file diff --git a/src/map/script.c b/src/map/script.c index a6d588113..b89121ee4 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -14968,6 +14968,23 @@ BUILDIN_FUNC(checkchatting) // check chatting [Marka] return 0; } +BUILDIN_FUNC(checkidle) +{ + TBL_PC *sd = NULL; + + if (script_hasdata(st, 2)) + sd = map_nick2sd(script_getstr(st, 2)); + else + sd = script_rid2sd(st); + + if (sd) + script_pushint(st, DIFF_TICK(last_tick, sd->idletime)); + else + script_pushint(st, 0); + + return 0; +} + BUILDIN_FUNC(searchitem) { struct script_data* data = script_getdata(st, 2); @@ -17689,6 +17706,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(roclass,"i?"), //[Skotlex] BUILDIN_DEF(checkvending,"?"), BUILDIN_DEF(checkchatting,"?"), + BUILDIN_DEF(checkidle,"?"), BUILDIN_DEF(openmail,""), BUILDIN_DEF(openauction,""), BUILDIN_DEF(checkcell,"siii"), -- cgit v1.2.3-70-g09d2 From ad792f41994ce54dc9e45fbdaaf591f38fccecee Mon Sep 17 00:00:00 2001 From: malufett Date: Wed, 27 Feb 2013 02:23:06 +0800 Subject: Fixed Bug #6527 -Where all NPC don't allow changing of equipments by default and now can be set in 'items.conf'. --- conf/battle/items.conf | 8 +++++++- doc/script_commands.txt | 18 ++++++++++-------- src/map/battle.c | 1 + src/map/battle.h | 1 + src/map/clif.c | 11 +++++++---- src/map/pc.c | 3 +-- src/map/script.c | 6 ++++-- src/map/script.h | 1 + 8 files changed, 32 insertions(+), 17 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/items.conf b/conf/battle/items.conf index 343b4212e..4401072d5 100644 --- a/conf/battle/items.conf +++ b/conf/battle/items.conf @@ -79,4 +79,10 @@ autospell_stacking: no // Will disabled consumables (disabled by item_noequip.txt) be consumed when trying to use them? // 1 (official): yes // 0: no -item_restricted_consumption_type:1 \ No newline at end of file +item_restricted_consumption_type:1 + +// Enable all NPC to allow changing of equipments while interacting? (Note 1) +// Script commands 'enable_items/disable_items' will not be override. (see doc/script_commands.txt) +// 1 : yes(official) +// 0 : no +item_enabled_npc:1 \ No newline at end of file diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a5ba6e065..22b316d2c 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1,4 +1,4 @@ -//===== Hercules Documentation ================================ +//===== Hercules Documentation ================================ //= Hercules Script Commands //===== By: ================================================== //= Hercules Dev Team @@ -1208,7 +1208,7 @@ with other command, such as "if", but often used on it's own. Label: mes "This will be seen"; -Note by FlavioJS: goto's are "evil" and should be avoided if possible (ò_ó) +Note by FlavioJS: goto's are "evil" and should be avoided if possible (_) --------------------------------------- @@ -4441,13 +4441,15 @@ getrandgroupitem(1,3); *enable_items; *disable_items; -These commands enable item usage while an NPC is running. When enable_items is -run, items can be used during scripts until disable_items is called. -To avoid possible exploits, when enable_items is invoked, it will only enable -item usage while running that script in particular. Note that if a different -script also calls enable_items, it will override the last call (so you may +These commands enable/disable changing of equipments while an NPC is running. When disable_items is +run, equipments cannot be changed during scripts until enable_items is called or the script has terminated. +To avoid possible exploits, when disable_items is invoked, it will only disable +changing equips while running that script in particular. Note that if a different +script also calls disable_items, it will override the last call (so you may want to call this command at the start of your script without assuming the effect is still in effect). +If 'item_enabled_npc' option is set to Yes in 'items.conf' all NPC are allowing changing of equipment by default +except for those have been set with 'disable_items'. --------------------------------------- @@ -6435,7 +6437,7 @@ placement of the illustration and takes following values: 3 - middle of screen in a movable window with an empty title bar 4 - middle of screen without the window header, but still movable -The picture is read from data\texture\유저인터페이스\illust, from both the GRF archive +The picture is read from data\texture\???????\illust, from both the GRF archive and data folder, and is required to be a bitmap. The file extension .bmp can be omitted. Magenta color (#ff00ff) is considered transparent. There is no limit placed on the size of the illustrations by the client, although loading of large diff --git a/src/map/battle.c b/src/map/battle.c index 7fc9ad237..949b91a29 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5913,6 +5913,7 @@ static const struct _battle_data { { "skill_trap_type", &battle_config.skill_trap_type, 0, 0, 1, }, { "item_restricted_consumption_type", &battle_config.item_restricted_consumption_type,1, 0, 1, }, { "max_walk_path", &battle_config.max_walk_path, 17, 1, MAX_WALKPATH, }, + { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, }, }; #ifndef STATS_OPT_OUT /** diff --git a/src/map/battle.h b/src/map/battle.h index 14bd70fee..0e888fc9e 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -489,6 +489,7 @@ extern struct Battle_Config int skill_trap_type; int item_restricted_consumption_type; int max_walk_path; + int item_enabled_npc; } battle_config; diff --git a/src/map/clif.c b/src/map/clif.c index 82ff333a1..ea05baa3c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10207,10 +10207,10 @@ void clif_parse_EquipItem(int fd,struct map_session_data *sd) if (index < 0 || index >= MAX_INVENTORY) return; //Out of bounds check. - if(sd->npc_id) { - if (sd->npc_id != sd->npc_item_flag) + if( sd->npc_id ) + if ( !sd->npc_item_flag ) return; - } else if (sd->state.storage_flag || sd->sc.opt1) + else if ( sd->state.storage_flag || sd->sc.opt1 ) ; //You can equip/unequip stuff while storage is open/under status changes else if ( pc_cant_act2(sd) ) return; @@ -10247,7 +10247,10 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd) return; } - if (sd->state.storage_flag || sd->sc.opt1) + if( sd->npc_id ) + if ( !sd->npc_item_flag ) + return; + else if ( sd->state.storage_flag || sd->sc.opt1 ) ; //You can equip/unequip stuff while storage is open/under status changes else if ( pc_cant_act2(sd) ) return; diff --git a/src/map/pc.c b/src/map/pc.c index 7eae16193..a3b1335c9 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4232,8 +4232,7 @@ int pc_useitem(struct map_session_data *sd,int n) nullpo_ret(sd); - //This flag enables you to use items while in an NPC. [Skotlex] - if( sd->npc_id && sd->npc_id != sd->npc_item_flag ){ + if( sd->npc_id ){ #ifdef RENEWAL clif_msg(sd, 0x783); // TODO look for the client date that has this message. #endif diff --git a/src/map/script.c b/src/map/script.c index c4ee96feb..604872dfd 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3017,6 +3017,7 @@ struct script_state* script_alloc_state(struct script_code* script, int pos, int st->rid = rid; st->oid = oid; st->sleep.timer = INVALID_TIMER; + st->npc_item_flag = battle_config.item_enabled_npc; return st; } @@ -3644,6 +3645,7 @@ static void script_attach_state(struct script_state* st) } sd->st = st; sd->npc_id = st->oid; + sd->npc_item_flag = st->npc_item_flag; // load default. /** * For the Secure NPC Timeout option (check config/Secure.h) [RR] **/ @@ -6964,7 +6966,7 @@ BUILDIN_FUNC(enableitemuse) TBL_PC *sd; sd=script_rid2sd(st); if (sd) - sd->npc_item_flag = st->oid; + st->npc_item_flag = sd->npc_item_flag = 1; return 0; } @@ -6973,7 +6975,7 @@ BUILDIN_FUNC(disableitemuse) TBL_PC *sd; sd=script_rid2sd(st); if (sd) - sd->npc_item_flag = 0; + st->npc_item_flag = sd->npc_item_flag = 0; return 0; } diff --git a/src/map/script.h b/src/map/script.h index b27b3d290..3e7f3087f 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -132,6 +132,7 @@ struct script_state { int bk_npcid; unsigned freeloop : 1;// used by buildin_freeloop unsigned op2ref : 1;// used by op_2 + unsigned npc_item_flag : 1; }; struct script_reg { -- cgit v1.2.3-70-g09d2 From bc63ef1225dadcfa2ba20a9b073de801ee177992 Mon Sep 17 00:00:00 2001 From: malufett Date: Fri, 8 Mar 2013 22:51:42 +0800 Subject: Fixed Bug #7114 -revised/added 'npc_isnear' where it checks if an NPC is nearby when making chat rooms or using vending. Signed-off-by: malufett --- conf/battle/player.conf | 4 ++-- src/map/battle.c | 2 +- src/map/battle.h | 2 +- src/map/clif.c | 22 ++++++++++++---------- src/map/npc.c | 18 ++++++++++++++++++ src/map/npc.h | 1 + src/map/pc.h | 4 ++-- src/map/skill.c | 10 +++++++++- src/map/vending.c | 30 +----------------------------- src/map/vending.h | 3 +-- 10 files changed, 48 insertions(+), 48 deletions(-) (limited to 'conf/battle') diff --git a/conf/battle/player.conf b/conf/battle/player.conf index cacc66e4d..b626f3ca0 100644 --- a/conf/battle/player.conf +++ b/conf/battle/player.conf @@ -139,6 +139,6 @@ character_size: 0 // items from Autoloot (0: disabled). idle_no_autoloot: 0 -// Minimum distance a vending must be from a NPC in order to be placed +// Minimum distance a vending/chat room must be from a NPC in order to be placed // Default: 3 (0: disabled). -min_npc_vending_distance: 3 \ No newline at end of file +min_npc_vendchat_distance: 3 \ No newline at end of file diff --git a/src/map/battle.c b/src/map/battle.c index 2cb88b123..ba1a4970b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5898,7 +5898,7 @@ static const struct _battle_data { { "skill_amotion_leniency", &battle_config.skill_amotion_leniency, 90, 0, 300 }, { "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1 }, { "feature.atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 }, - { "min_npc_vending_distance", &battle_config.min_npc_vending_distance, 3, 0, 100 }, + { "min_npc_vendchat_distance", &battle_config.min_npc_vendchat_distance, 3, 0, 100 }, { "atcommand_mobinfo_type", &battle_config.atcommand_mobinfo_type, 0, 0, 1 }, { "homunculus_max_level", &battle_config.hom_max_level, 99, 0, MAX_LEVEL, }, { "homunculus_S_max_level", &battle_config.hom_S_max_level, 150, 0, MAX_LEVEL, }, diff --git a/src/map/battle.h b/src/map/battle.h index 6aa6ade03..e81990f21 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -453,7 +453,7 @@ struct Battle_Config { int mvp_tomb_enabled; int atcommand_suggestions_enabled; - int min_npc_vending_distance; + int min_npc_vendchat_distance; int atcommand_mobinfo_type; int mob_size_influence; // Enable modifications on earned experience, drop rates and monster status depending on monster size. [mkbu95] diff --git a/src/map/clif.c b/src/map/clif.c index bfde233c5..ed9eb1769 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10400,6 +10400,14 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) clif_skill_fail(sd,1,USESKILL_FAIL_LEVEL,3); return; } + if( npc_isnear(&sd->bl) ) { + // uncomment for more verbose message. + //char output[150]; + //sprintf(output, msg_txt(662), battle_config.min_npc_vendchat_distance); + //clif_displaymessage(sd->fd, output); + clif_skill_fail(sd,1,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0); + return; + } if( len <= 0 ) return; // invalid input @@ -11890,6 +11898,9 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) const char* message = (char*)RFIFOP(fd,4); bool flag = (bool)RFIFOB(fd,84); const uint8* data = (uint8*)RFIFOP(fd,85); + + if( !flag ) + sd->state.prevend = 0; if( sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM ) return; @@ -11902,21 +11913,12 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) return; } - if( vending_checknearnpc(&sd->bl) ) { - char output[150]; - sprintf(output, msg_txt(662), battle_config.min_npc_vending_distance); - clif_displaymessage(sd->fd, output); - clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); - return; - } - if( message[0] == '\0' ) // invalid input return; - vending_openvending(sd, message, flag, data, len/8); + vending_openvending(sd, message, data, len/8); } - /// Guild creation request (CZ_REQ_MAKE_GUILD). /// 0165 .L .24B void clif_parse_CreateGuild(int fd,struct map_session_data *sd) diff --git a/src/map/npc.c b/src/map/npc.c index e032a28a7..0c9924d46 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -113,6 +113,24 @@ struct view_data* npc_get_viewdata(int class_) return NULL; } +static int npc_isnear_sub(struct block_list* bl, va_list args) { + struct npc_data *nd = (struct npc_data*)bl; + + if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) ) + return 0; + + return 1; +} + +bool npc_isnear(struct block_list * bl) { + + if( battle_config.min_npc_vendchat_distance > 0 && + map_foreachinrange(npc_isnear_sub,bl, battle_config.min_npc_vendchat_distance, BL_NPC) ) + return true; + + return false; +} + int npc_ontouch_event(struct map_session_data *sd, struct npc_data *nd) { char name[EVENT_NAME_LENGTH]; diff --git a/src/map/npc.h b/src/map/npc.h index 7b69cac34..20ce34459 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -134,6 +134,7 @@ int npc_enable(const char* name, int flag); void npc_setdisplayname(struct npc_data* nd, const char* newname); void npc_setclass(struct npc_data* nd, short class_); struct npc_data* npc_name2id(const char* name); +bool npc_isnear(struct block_list * bl); int npc_get_new_npc_id(void); diff --git a/src/map/pc.h b/src/map/pc.h index 1b00b7191..d62c6359e 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -593,10 +593,10 @@ enum equip_index { #define pc_issit(sd) ( (sd)->vd.dead_sit == 2 ) #define pc_isidle(sd) ( (sd)->chatID || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(last_tick, (sd)->idletime) >= battle_config.idle_no_share ) #define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading ) -#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag ) +#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chatID || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend ) /* equals pc_cant_act except it doesn't check for chat rooms */ -#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag ) +#define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend ) #define pc_setdir(sd,b,h) ( (sd)->ud.dir = (b) ,(sd)->head_dir = (h) ) #define pc_setchatid(sd,n) ( (sd)->chatID = n ) diff --git a/src/map/skill.c b/src/map/skill.c index a8b852cc7..fdfdbcee7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -571,8 +571,16 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd) } break; case MC_VENDING: - case MC_IDENTIFY: case ALL_BUYING_STORE: + if( npc_isnear(&sd->bl) ) { + // uncomment for more verbose message. + //char output[150]; + //sprintf(output, msg_txt(662), battle_config.min_npc_vendchat_distance); + //clif_displaymessage(sd->fd, output); + clif_skill_fail(sd,skill_id,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0); + return 1; + } + case MC_IDENTIFY: return 0; // always allowed case WZ_ICEWALL: // noicewall flag [Valaris] diff --git a/src/map/vending.c b/src/map/vending.c index 0f8255788..5f0ac7501 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -231,34 +231,16 @@ void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const ui } } } -static int vending_checknearnpc_sub(struct block_list* bl, va_list args) { - struct npc_data *nd = (struct npc_data*)bl; - - if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) ) - return 0; - return 1; -} -bool vending_checknearnpc(struct block_list * bl) { - - if( battle_config.min_npc_vending_distance > 0 && - map_foreachinrange(vending_checknearnpc_sub,bl, battle_config.min_npc_vending_distance, BL_NPC) ) - return true; - - return false; -} /*========================================== * Open shop * data := {.w .w .l}[count] *------------------------------------------*/ -void vending_openvending(struct map_session_data* sd, const char* message, bool flag, const uint8* data, int count) { +void vending_openvending(struct map_session_data* sd, const char* message, const uint8* data, int count) { int i, j; int vending_skill_lvl; nullpo_retv(sd); - if( !flag ) // cancelled - return; // nothing to do - if ( pc_isdead(sd) || !sd->state.prevend || pc_istrading(sd)) return; // can't open vendings lying dead || didn't use via the skill (wpe/hack) || can't have 2 shops at once @@ -276,15 +258,6 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); return; } - //check if nearby npc, (perhaps we should check for nearby shop too - if( vending_checknearnpc(&sd->bl) ) { - char output[150]; - sprintf(output,"You're too close to a NPC, you must be at least %d cells away from any NPC.",battle_config.min_npc_vending_distance); - clif_displaymessage(sd->fd, output); - clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); - return; - } - // filter out invalid items i = 0; @@ -326,7 +299,6 @@ void vending_openvending(struct map_session_data* sd, const char* message, bool sd->vend_num = i; safestrncpy(sd->message, message, MESSAGE_SIZE); - pc_stop_walking(sd,1); clif_openvending(sd,sd->bl.id,sd->vending); clif_showvendingboard(&sd->bl,message,0); } diff --git a/src/map/vending.h b/src/map/vending.h index 2ed52b9bd..402df5579 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -16,11 +16,10 @@ struct s_vending { }; void vending_closevending(struct map_session_data* sd); -void vending_openvending(struct map_session_data* sd, const char* message, bool flag, const uint8* data, int count); +void vending_openvending(struct map_session_data* sd, const char* message, const uint8* data, int count); void vending_vendinglistreq(struct map_session_data* sd, int id); void vending_purchasereq(struct map_session_data* sd, int aid, int uid, const uint8* data, int count); bool vending_search(struct map_session_data* sd, unsigned short nameid); bool vending_searchall(struct map_session_data* sd, const struct s_search_store_search* s); -bool vending_checknearnpc(struct block_list * bl); #endif /* _VENDING_H_ */ -- cgit v1.2.3-70-g09d2 From 7ec1e8fdff6adad1979d750774f9003f223bf3ef Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 30 Mar 2013 23:08:08 -0300 Subject: Hercules Renewal: clif.c complete Added the last missing functions into the interface, all functions in clif.c are now wired to the interface. http://hercules.ws/board/topic/237-hercules-renewal/ Also shortened clif->displaymessage to clif->message, removed the old clif->message and merged its functionality with clif->disp_overhead (both use the same packet and do the same thing :P) - and a gazillion other stuff: http://hercules.ws/board/topic/316-introducing-hercules-channel-system/ Signed-off-by: shennetsind --- conf/atcommand.conf | 1 + conf/battle/items.conf | 2 +- conf/channels.conf | 39 + conf/groups.conf | 3 +- conf/help.txt | 1 - conf/inter-server.conf | 4 - conf/messages.conf | 43 + doc/permissions.txt | 5 +- src/char/char.c | 2 +- src/char/inter.c | 3 - src/char/inter.h | 2 - src/common/mmo.h | 5 +- src/map/atcommand.c | 1901 +++++++++++++++----------- src/map/battle.c | 54 +- src/map/buyingstore.c | 14 +- src/map/chat.c | 4 +- src/map/chrif.c | 14 +- src/map/clif.c | 3536 ++++++++++++++++++++++++++---------------------- src/map/clif.h | 313 ++++- src/map/guild.c | 153 ++- src/map/homunculus.c | 2 +- src/map/intif.c | 13 +- src/map/map.c | 38 +- src/map/map.h | 7 +- src/map/npc.c | 2 + src/map/party.c | 14 +- src/map/pc.c | 39 +- src/map/pc.h | 12 +- src/map/pc_groups.h | 2 + src/map/pet.c | 2 +- src/map/script.c | 26 +- src/map/skill.c | 10 +- src/map/storage.c | 8 +- src/map/trade.c | 8 +- src/map/vending.c | 4 +- 35 files changed, 3668 insertions(+), 2618 deletions(-) create mode 100644 conf/channels.conf (limited to 'conf/battle') diff --git a/conf/atcommand.conf b/conf/atcommand.conf index 5a0a5b289..67af3b91f 100644 --- a/conf/atcommand.conf +++ b/conf/atcommand.conf @@ -56,6 +56,7 @@ aliases: { guildstorage: ["gstorage"] accinfo: ["accountinfo"] itemreset: ["clearinventory"] + channel: ["main"] } /* Commands help file */ diff --git a/conf/battle/items.conf b/conf/battle/items.conf index 4401072d5..05aadfecd 100644 --- a/conf/battle/items.conf +++ b/conf/battle/items.conf @@ -76,7 +76,7 @@ gtb_sc_immunity: 50 // always work independently of each other regardless of setting. autospell_stacking: no -// Will disabled consumables (disabled by item_noequip.txt) be consumed when trying to use them? +// Will disabled consumables (disabled by map_zone_db.conf) be consumed when trying to use them? // 1 (official): yes // 0: no item_restricted_consumption_type:1 diff --git a/conf/channels.conf b/conf/channels.conf new file mode 100644 index 000000000..b12d2da8b --- /dev/null +++ b/conf/channels.conf @@ -0,0 +1,39 @@ +chsys: ( +{ + /* default channels (available on boot) */ + default_channels: { + /* channel_name : channel_messages_color */ + main: "Orange" /* available as #main */ + support: "Blue" /* available as #support */ + trade: "Red" /* available as #trade */ + offtopic: "Cyan" /* available as #offtopic */ + /* as many channels as you like */ + } + /* colors available */ + colors: { + Default: "0xffffff" /* custom channels will use the first in the list unless a font is selected thru @channel */ + Red: "0xff0000" + Blue: "0x83cfe9" + Orange: "0xe57c00" + Cyan: "0x00b89d" + Yellow: "0xffff90" + Green: "0x28bf00" + Normal: "0x00ff00" + /* as many colors as you like */ + } + /* allow users to create their own (private) channels through @channels command? */ + /* (must also allow players to use @channels in groups.conf) */ + allow_user_channel_creation: true + /* "map_local_channel" is a instanced channel unique to each map */ + map_local_channel: true + map_local_channel_name: "map" /* available as #map */ + map_local_channel_color: "Yellow" + map_local_channel_autojoin: true /* can disable autojoin in specific maps through a mapflag or zone */ + /* "ally_channel" is a channel shared by all your guild allies */ + ally_channel_enabled: true + ally_channel_name: "ally" /* available as #ally */ + ally_channel_color: "Green" + ally_channel_autojoin: true +} +) + diff --git a/conf/groups.conf b/conf/groups.conf index a243716e6..879361387 100644 --- a/conf/groups.conf +++ b/conf/groups.conf @@ -123,13 +123,13 @@ groups: ( refresh: true noask: true noks: true - main: true autoloot: true alootid: true autotrade: true request: true go: true breakguild: true + channel: true } permissions: { } @@ -272,6 +272,7 @@ groups: ( use_check: true use_changemaptype: true all_commands: true + hchsys_admin: true } } ) diff --git a/conf/help.txt b/conf/help.txt index 105371e9f..6f202091e 100644 --- a/conf/help.txt +++ b/conf/help.txt @@ -6,7 +6,6 @@ // This file uses libconfig syntax. help: "Params: \n" "Shows help for specified command." -main: "Params: [on|off|]\n" "Turns on or off main (server-wide) chat. Sends message to main chat." noask: "Auto rejects deals/invites." gmotd: "Broadcasts the Message of The Day to all players." me: "Params: \n" "Displays normal text as a message in this format: *name message* (like /me in mIRC)." diff --git a/conf/inter-server.conf b/conf/inter-server.conf index 523437007..bf8d9e7a3 100644 --- a/conf/inter-server.conf +++ b/conf/inter-server.conf @@ -119,8 +119,4 @@ mapreg_db: mapreg //Use SQL item_db, mob_db and mob_skill_db for the map server use_sql_db: no -// Nick for sending mainchat -// messages like whisper -main_chat_nick: Main - import: conf/import/inter_conf.txt diff --git a/conf/messages.conf b/conf/messages.conf index 6025ecd81..7666badf3 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1409,5 +1409,48 @@ // @skillid (extension) 1398: -- Displaying first %d partial matches +// @join +1399: Unknown Channel (usage: %s <#channel_name>) +1400: Unknown Channel '%s' (usage: %s <#channel_name>) +1401: '%s' Channel is password protected (usage: %s <#channel_name> ) +1403: You're now in the '%s' channel + +// Hercules Chat Feature +1402: You're not in that channel, type '@join <#channel_name>' +1434: You're already in the '%s' channel +1435: You're now in the '#%s' channel for '%s' + +// @channel +1404: %s failed +1405: Channel name must start with a '#' +1406: Channel length must be between 3 and %d +1407: Channel '%s' is not available +1408: Channel password may not contain spaces +1409: - #%s ( %d users ) +1410: -- Public Channels +1411: Unknown color '%s' +1412: You're not the owner of channel '%s' +1413: '%s' channel color updated to '%s' +1414: --- Available options: +1415: -- %s create +1416: - creates a new channel +1417: -- %s list +1418: - lists public channels +1419: -- %s list colors +1420: - lists colors available to select for custom channels +1421: -- %s setcolor +1422: - changes color to +1423: -- %s leave +1424: - leaves +1425: You're not part of the '%s' channel +1426: You've left the '%s' channel +1427: -- %s bindto +1428: - binds your global chat to , making anything you type in global be sent to the channel +1429: -- %s unbind +1430: - unbinds your global chat from its attached channel (if binded) +1431: Your global chat is now binded to the '%s' channel +1432: Your global chat is not binded to any channel +1433: Your global chat is now unbinded from the '#%s' channel + //Custom translations import: conf/import/msg_conf.txt diff --git a/doc/permissions.txt b/doc/permissions.txt index 619282c94..1dbfd0056 100644 --- a/doc/permissions.txt +++ b/doc/permissions.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= Hercules Dev Team //===== Current Version: ===================================== -//= 20120606 +//= 20130330 //===== Description: ========================================= //= Player group permissions, configured in /conf/groups.conf. //============================================================ @@ -30,4 +30,5 @@ receive_requests : Ability to receive @requests. show_bossmobs : Ability to see boss mobs with @showmobs. disable_pvm : Ability to disable Player vs. Monster. disable_pvp : Ability to disable Player vs. Player. -disable_commands_when_dead : Ability to disable @command usage when dead. \ No newline at end of file +disable_commands_when_dead : Ability to disable @command usage when dead. +hchsys_admin : Hercules Chat System Admin (can modify channels settings regardless of ownership and join password-protected channels without password) \ No newline at end of file diff --git a/src/char/char.c b/src/char/char.c index 1745c061f..9e2400ddf 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -1465,7 +1465,7 @@ int check_char_name(char * name, char * esc_name) return -2; // control chars in name // check for reserved names - if( strcmpi(name, main_chat_nick) == 0 || strcmpi(name, wisp_server_name) == 0 ) + if( strcmpi(name, wisp_server_name) == 0 ) return -1; // nick reserved for internal server messages // Check Authorised letters/symbols in the name of the character diff --git a/src/char/inter.c b/src/char/inter.c index da790e200..dec217d02 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -43,7 +43,6 @@ char default_codepage[32] = ""; //Feature by irmin. static struct accreg *accreg_pt; unsigned int party_share_level = 10; -char main_chat_nick[16] = "Main"; // recv. packet list int inter_recv_packet_length[] = { @@ -731,8 +730,6 @@ static int inter_config_read(const char* cfgName) party_share_level = atoi(w2); else if(!strcmpi(w1,"log_inter")) log_inter = atoi(w2); - else if(!strcmpi(w1,"main_chat_nick")) - safestrncpy(main_chat_nick, w2, sizeof(main_chat_nick)); else if(!strcmpi(w1,"import")) inter_config_read(w2); } diff --git a/src/char/inter.h b/src/char/inter.h index 9f99197eb..e34c54c16 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -23,8 +23,6 @@ extern unsigned int party_share_level; extern Sql* sql_handle; extern Sql* lsql_handle; -extern char main_chat_nick[16]; - int inter_accreg_tosql(int account_id, int char_id, struct accreg *reg, int type); uint64 inter_chk_lastuid(int8 flag, uint64 value); diff --git a/src/common/mmo.h b/src/common/mmo.h index 56770fe02..7d1928201 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -5,6 +5,7 @@ #define _MMO_H_ #include "cbasetypes.h" +#include "../common/db.h" #include // server->client protocol version @@ -510,8 +511,10 @@ struct guild { struct guild_alliance alliance[MAX_GUILDALLIANCE]; struct guild_expulsion expulsion[MAX_GUILDEXPULSION]; struct guild_skill skill[MAX_GUILDSKILL]; - + + /* TODO: still used for something?|: */ unsigned short save_flag; // for TXT saving + void *channel; }; struct guild_castle { diff --git a/src/map/atcommand.c b/src/map/atcommand.c index a585e6cc8..94838f699 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -219,21 +219,21 @@ ACMD_FUNC(send) { int i; for (i = 900; i <= 903; ++i) - clif->displaymessage(fd, msg_txt(i)); + clif->message(fd, msg_txt(i)); return -1; } #define PARSE_ERROR(error,p) \ {\ - clif->displaymessage(fd, (error));\ + clif->message(fd, (error));\ sprintf(atcmd_output, ">%s", (p));\ - clif->displaymessage(fd, atcmd_output);\ + clif->message(fd, atcmd_output);\ } //define PARSE_ERROR #define CHECK_EOS(p) \ if(*(p) == 0){\ - clif->displaymessage(fd, "Unexpected end of string");\ + clif->message(fd, "Unexpected end of string");\ return -1;\ } //define CHECK_EOS @@ -259,7 +259,7 @@ ACMD_FUNC(send) if(len) {// show packet length sprintf(atcmd_output, msg_txt(904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -268,7 +268,7 @@ ACMD_FUNC(send) if(len == 0) {// unknown packet - ERROR sprintf(atcmd_output, msg_txt(905), type); // Unknown packet: 0x%x - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } else if(len == -1) {// dynamic packet @@ -425,11 +425,11 @@ ACMD_FUNC(send) WFIFOSET(fd,len); } } else { - clif->displaymessage(fd, msg_txt(259)); // Invalid packet + clif->message(fd, msg_txt(259)); // Invalid packet return -1; } sprintf (atcmd_output, msg_txt(258), type, type); // Sent packet 0x%x (%d) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; #undef PARSE_ERROR #undef CHECK_EOS @@ -455,7 +455,7 @@ ACMD_FUNC(mapmove) (sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 && sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) { - clif->displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove ). + clif->message(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove ). return -1; } @@ -464,30 +464,30 @@ ACMD_FUNC(mapmove) m = map_mapindex2mapid(mapindex); if (!mapindex) { // m < 0 means on different server! [Kevin] - clif->displaymessage(fd, msg_txt(1)); // Map not found. + clif->message(fd, msg_txt(1)); // Map not found. return -1; } if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. - clif->displaymessage(fd, msg_txt(2)); + clif->message(fd, msg_txt(2)); if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } if (map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(247)); + clif->message(fd, msg_txt(247)); return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(248)); + clif->message(fd, msg_txt(248)); return -1; } if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != 0) { - clif->displaymessage(fd, msg_txt(1)); // Map not found. + clif->message(fd, msg_txt(1)); // Map not found. return -1; } - clif->displaymessage(fd, msg_txt(0)); // Warped. + clif->message(fd, msg_txt(0)); // Warped. return 0; } @@ -502,7 +502,7 @@ ACMD_FUNC(where) memset(atcmd_player_name, '\0', sizeof atcmd_player_name); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { - clif->displaymessage(fd, msg_txt(910)); // Please enter a player name (usage: @where ). + clif->message(fd, msg_txt(910)); // Please enter a player name (usage: @where ). return -1; } @@ -511,12 +511,12 @@ ACMD_FUNC(where) strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 || (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) ) { - clif->displaymessage(fd, msg_txt(3)); // Character not found. + clif->message(fd, msg_txt(3)); // Character not found. return -1; } snprintf(atcmd_output, sizeof atcmd_output, "%s %s %d %d", pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -531,37 +531,37 @@ ACMD_FUNC(jumpto) nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto ). + clif->message(fd, msg_txt(911)); // Please enter a player name (usage: @jumpto/@warpto/@goto ). return -1; } if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) { - clif->displaymessage(fd, msg_txt(3)); // Character not found. + clif->message(fd, msg_txt(3)); // Character not found. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(247)); // You are not authorized to warp to this map. + clif->message(fd, msg_txt(247)); // You are not authorized to warp to this map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif->message(fd, msg_txt(248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { - clif->displaymessage(fd, msg_txt(664)); + clif->message(fd, msg_txt(664)); return -1; } pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(4), pl_sd->status.name); // Jumped to %s - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -580,26 +580,26 @@ ACMD_FUNC(jump) sscanf(message, "%hd %hd", &x, &y); if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif->message(fd, msg_txt(248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { - clif->displaymessage(fd, msg_txt(664)); + clif->message(fd, msg_txt(664)); return -1; } if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. - clif->displaymessage(fd, msg_txt(2)); + clif->message(fd, msg_txt(2)); if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(5), sd->bl.x, sd->bl.y); // Jumped to %d %d - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -667,7 +667,7 @@ ACMD_FUNC(who) } default: { struct party_data *p = party_search(pl_sd->status.party_id); - struct guild *g = guild_search(pl_sd->status.guild_id); + struct guild *g = pl_sd->guild; StringBuf_Printf(&buf, msg_txt(343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists @@ -679,7 +679,7 @@ ACMD_FUNC(who) break; } } - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); count++; } @@ -701,7 +701,7 @@ ACMD_FUNC(who) else StringBuf_Printf(&buf, msg_txt(56), count, map[map_id].name); // %d players found in map '%s'. } - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); return 0; } @@ -754,7 +754,7 @@ ACMD_FUNC(whogm) if (pl_sd->sc.option & OPTION_INVISIBLE) continue; sprintf(atcmd_output, msg_txt(913), pl_sd->status.name); // Name: %s (GM) - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); count++; continue; } @@ -762,31 +762,31 @@ ACMD_FUNC(whogm) sprintf(atcmd_output, msg_txt(914), // Name: %s (GM:%d) | Location: %s %d %d pl_sd->status.name, pl_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(915), // BLvl: %d | Job: %s (Lvl: %d) pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); p = party_search(pl_sd->status.party_id); - g = guild_search(pl_sd->status.guild_id); + g = pl_sd->guild; sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s' p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); count++; } mapit_free(iter); if (count == 0) - clif->displaymessage(fd, msg_txt(150)); // No GM found. + clif->message(fd, msg_txt(150)); // No GM found. else if (count == 1) - clif->displaymessage(fd, msg_txt(151)); // 1 GM found. + clif->message(fd, msg_txt(151)); // 1 GM found. else { sprintf(atcmd_output, msg_txt(152), count); // %d GMs found. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -805,7 +805,7 @@ ACMD_FUNC(save) chrif_save(sd,0); - clif->displaymessage(fd, msg_txt(6)); // Your save point has been changed. + clif->message(fd, msg_txt(6)); // Your save point has been changed. return 0; } @@ -821,16 +821,16 @@ ACMD_FUNC(load) m = map_mapindex2mapid(sd->status.save_point.map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(249)); // You are not authorized to warp to your save map. + clif->message(fd, msg_txt(249)); // You are not authorized to warp to your save map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(248)); // You are not authorized to warp from your current map. + clif->message(fd, msg_txt(248)); // You are not authorized to warp from your current map. return -1; } pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT); - clif->displaymessage(fd, msg_txt(7)); // Warping to save point.. + clif->message(fd, msg_txt(7)); // Warping to save point.. return 0; } @@ -848,13 +848,13 @@ ACMD_FUNC(speed) if (!message || !*message || sscanf(message, "%d", &speed) < 1) { sprintf(atcmd_output, msg_txt(918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>). - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED); status_calc_bl(&sd->bl, SCB_SPEED); - clif->displaymessage(fd, msg_txt(8)); // Speed changed. + clif->message(fd, msg_txt(8)); // Speed changed. return 0; } @@ -870,11 +870,11 @@ ACMD_FUNC(storage) if (storage_storageopen(sd) == 1) { //Already open. - clif->displaymessage(fd, msg_txt(250)); + clif->message(fd, msg_txt(250)); return -1; } - clif->displaymessage(fd, msg_txt(919)); // Storage opened. + clif->message(fd, msg_txt(919)); // Storage opened. return 0; } @@ -888,7 +888,7 @@ ACMD_FUNC(guildstorage) nullpo_retr(-1, sd); if (!sd->status.guild_id) { - clif->displaymessage(fd, msg_txt(252)); + clif->message(fd, msg_txt(252)); return -1; } @@ -896,17 +896,17 @@ ACMD_FUNC(guildstorage) return -1; if (sd->state.storage_flag == 1) { - clif->displaymessage(fd, msg_txt(250)); + clif->message(fd, msg_txt(250)); return -1; } if (sd->state.storage_flag == 2) { - clif->displaymessage(fd, msg_txt(251)); + clif->message(fd, msg_txt(251)); return -1; } storage_guild_storageopen(sd); - clif->displaymessage(fd, msg_txt(920)); // Guild storage opened. + clif->message(fd, msg_txt(920)); // Guild storage opened. return 0; } @@ -926,11 +926,11 @@ ACMD_FUNC(option) text = atcommand_help_string( command ); // notify the user of the requirement to enter an option - clif->displaymessage(fd, msg_txt(921)); // Please enter at least one option. + clif->message(fd, msg_txt(921)); // Please enter at least one option. if( text ) {// send the help text associated with this command - clif->displaymessage( fd, text ); + clif->message( fd, text ); } return -1; @@ -940,7 +940,7 @@ ACMD_FUNC(option) sd->sc.opt2 = param2; pc_setoption(sd, param3); - clif->displaymessage(fd, msg_txt(9)); // Options changed. + clif->message(fd, msg_txt(9)); // Options changed. return 0; } @@ -957,7 +957,7 @@ ACMD_FUNC(hide) status_set_viewdata(&sd->bl, sd->disguise); else status_set_viewdata(&sd->bl, sd->status.class_); - clif->displaymessage(fd, msg_txt(10)); // Invisible: Off + clif->message(fd, msg_txt(10)); // Invisible: Off // increment the number of pvp players on the map map[sd->bl.m].users_pvp++; @@ -971,7 +971,7 @@ ACMD_FUNC(hide) } else { sd->sc.option |= OPTION_INVISIBLE; sd->vd.class_ = INVISIBLE_CLASS; - clif->displaymessage(fd, msg_txt(11)); // Invisible: On + clif->message(fd, msg_txt(11)); // Invisible: On // decrement the number of pvp players on the map map[sd->bl.m].users_pvp--; @@ -1011,7 +1011,7 @@ ACMD_FUNC(jobchange) if (!found) { text = atcommand_help_string(command); if (text) - clif->displaymessage(fd, text); + clif->message(fd, text); return -1; } } @@ -1020,21 +1020,21 @@ ACMD_FUNC(jobchange) || job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2 || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2) ) // Deny direct transformation into dummy jobs - {clif->displaymessage(fd, msg_txt(923)); //"You can not change to this job by command." + {clif->message(fd, msg_txt(923)); //"You can not change to this job by command." return 0;} if (pcdb_checkid(job)) { if (pc_jobchange(sd, job, upper) == 0) - clif->displaymessage(fd, msg_txt(12)); // Your job has been changed. + clif->message(fd, msg_txt(12)); // Your job has been changed. else { - clif->displaymessage(fd, msg_txt(155)); // You are unable to change your job. + clif->message(fd, msg_txt(155)); // You are unable to change your job. return -1; } } else { text = atcommand_help_string(command); if (text) - clif->displaymessage(fd, text); + clif->message(fd, text); return -1; } @@ -1048,9 +1048,9 @@ ACMD_FUNC(kill) { nullpo_retr(-1, sd); status_kill(&sd->bl); - clif->displaymessage(sd->fd, msg_txt(13)); // A pity! You've died. + clif->message(sd->fd, msg_txt(13)); // A pity! You've died. if (fd != sd->fd) - clif->displaymessage(fd, msg_txt(14)); // Character killed. + clif->message(fd, msg_txt(14)); // Character killed. return 0; } @@ -1062,11 +1062,11 @@ ACMD_FUNC(alive) nullpo_retr(-1, sd); if (!status_revive(&sd->bl, 100, 100)) { - clif->displaymessage(fd, msg_txt(667)); + clif->message(fd, msg_txt(667)); return -1; } clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); - clif->displaymessage(fd, msg_txt(16)); // You've been revived! It's a miracle! + clif->message(fd, msg_txt(16)); // You've been revived! It's a miracle! return 0; } @@ -1082,7 +1082,7 @@ ACMD_FUNC(kami) if(*(command + 5) != 'c' && *(command + 5) != 'C') { if (!message || !*message) { - clif->displaymessage(fd, msg_txt(980)); // Please enter a message (usage: @kami ). + clif->message(fd, msg_txt(980)); // Please enter a message (usage: @kami ). return -1; } @@ -1093,12 +1093,12 @@ ACMD_FUNC(kami) intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? 0x10 : 0); } else { if(!message || !*message || (sscanf(message, "%lx %199[^\n]", &color, atcmd_output) < 2)) { - clif->displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic ). + clif->message(fd, msg_txt(981)); // Please enter color and message (usage: @kamic ). return -1; } if(color > 0xFFFFFF) { - clif->displaymessage(fd, msg_txt(982)); // Invalid color. + clif->message(fd, msg_txt(982)); // Invalid color. return -1; } intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0); @@ -1113,33 +1113,40 @@ ACMD_FUNC(heal) { int hp = 0, sp = 0; // [Valaris] thanks to fov nullpo_retr(-1, sd); - + sscanf(message, "%d %d", &hp, &sp); + WFIFOHEAD(fd, 4); + WFIFOW(fd, 0) = 0x23e; + WFIFOW(fd, 2) = hp; + WFIFOSET(fd, 4); + ShowDebug("Sending~! %d\n",hp); + + // some overflow checks if( hp == INT_MIN ) hp++; if( sp == INT_MIN ) sp++; if ( hp == 0 && sp == 0 ) { if (!status_percent_heal(&sd->bl, 100, 100)) - clif->displaymessage(fd, msg_txt(157)); // HP and SP have already been recovered. + clif->message(fd, msg_txt(157)); // HP and SP have already been recovered. else - clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif->message(fd, msg_txt(17)); // HP, SP recovered. return 0; } if ( hp > 0 && sp >= 0 ) { if(!status_heal(&sd->bl, hp, sp, 0)) - clif->displaymessage(fd, msg_txt(157)); // HP and SP are already with the good value. + clif->message(fd, msg_txt(157)); // HP and SP are already with the good value. else - clif->displaymessage(fd, msg_txt(17)); // HP, SP recovered. + clif->message(fd, msg_txt(17)); // HP, SP recovered. return 0; } if ( hp < 0 && sp <= 0 ) { status_damage(NULL, &sd->bl, -hp, -sp, 0, 0); clif->damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, 4, 0); - clif->displaymessage(fd, msg_txt(156)); // HP or/and SP modified. + clif->message(fd, msg_txt(156)); // HP or/and SP modified. return 0; } @@ -1160,7 +1167,7 @@ ACMD_FUNC(heal) status_damage(NULL, &sd->bl, 0, -sp, 0, 0); } - clif->displaymessage(fd, msg_txt(156)); // HP or/and SP modified. + clif->message(fd, msg_txt(156)); // HP or/and SP modified. return 0; } @@ -1182,7 +1189,7 @@ ACMD_FUNC(item) sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && sscanf(message, "%99s %d", item_name, &number) < 1 )) { - clif->displaymessage(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item ). + clif->message(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item ). return -1; } @@ -1192,7 +1199,7 @@ ACMD_FUNC(item) if ((item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL) { - clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif->message(fd, msg_txt(19)); // Invalid item ID or name. return -1; } @@ -1215,7 +1222,7 @@ ACMD_FUNC(item) } if (flag == 0) - clif->displaymessage(fd, msg_txt(18)); // Item created. + clif->message(fd, msg_txt(18)); // Item created. return 0; } @@ -1238,8 +1245,8 @@ ACMD_FUNC(item2) sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 && sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 )) { - clif->displaymessage(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 - clif->displaymessage(fd, msg_txt(985)); // ). + clif->message(fd, msg_txt(984)); // Please enter all parameters (usage: @item2 + clif->message(fd, msg_txt(985)); // ). return -1; } @@ -1287,9 +1294,9 @@ ACMD_FUNC(item2) } if (flag == 0) - clif->displaymessage(fd, msg_txt(18)); // Item created. + clif->message(fd, msg_txt(18)); // Item created. } else { - clif->displaymessage(fd, msg_txt(19)); // Invalid item ID or name. + clif->message(fd, msg_txt(19)); // Invalid item ID or name. return -1; } @@ -1309,7 +1316,7 @@ ACMD_FUNC(itemreset) pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); } } - clif->displaymessage(fd, msg_txt(20)); // All of your items have been removed. + clif->message(fd, msg_txt(20)); // All of your items have been removed. return 0; } @@ -1324,13 +1331,13 @@ ACMD_FUNC(baselevelup) level = atoi(message); if (!message || !*message || !level) { - clif->displaymessage(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup ). + clif->message(fd, msg_txt(986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup ). return -1; } if (level > 0) { if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris - clif->displaymessage(fd, msg_txt(47)); // Base level can't go any higher. + clif->message(fd, msg_txt(47)); // Base level can't go any higher. return -1; } // End Addition if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positiv overflow @@ -1342,10 +1349,10 @@ ACMD_FUNC(baselevelup) sd->status.base_level += (unsigned int)level; status_percent_heal(&sd->bl, 100, 100); clif->misceffect(&sd->bl, 0); - clif->displaymessage(fd, msg_txt(21)); // Base level raised. + clif->message(fd, msg_txt(21)); // Base level raised. } else { if (sd->status.base_level == 1) { - clif->displaymessage(fd, msg_txt(158)); // Base level can't go any lower. + clif->message(fd, msg_txt(158)); // Base level can't go any lower. return -1; } level*=-1; @@ -1360,7 +1367,7 @@ ACMD_FUNC(baselevelup) else sd->status.status_point -= status_point; sd->status.base_level -= (unsigned int)level; - clif->displaymessage(fd, msg_txt(22)); // Base level lowered. + clif->message(fd, msg_txt(22)); // Base level lowered. } sd->status.base_exp = 0; clif->updatestatus(sd, SP_STATUSPOINT); @@ -1385,12 +1392,12 @@ ACMD_FUNC(joblevelup) level = atoi(message); if (!message || !*message || !level) { - clif->displaymessage(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup ). + clif->message(fd, msg_txt(987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup ). return -1; } if (level > 0) { if (sd->status.job_level >= pc_maxjoblv(sd)) { - clif->displaymessage(fd, msg_txt(23)); // Job level can't go any higher. + clif->message(fd, msg_txt(23)); // Job level can't go any higher. return -1; } if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positiv overflow @@ -1398,10 +1405,10 @@ ACMD_FUNC(joblevelup) sd->status.job_level += (unsigned int)level; sd->status.skill_point += level; clif->misceffect(&sd->bl, 1); - clif->displaymessage(fd, msg_txt(24)); // Job level raised. + clif->message(fd, msg_txt(24)); // Job level raised. } else { if (sd->status.job_level == 1) { - clif->displaymessage(fd, msg_txt(159)); // Job level can't go any lower. + clif->message(fd, msg_txt(159)); // Job level can't go any lower. return -1; } level *=-1; @@ -1414,7 +1421,7 @@ ACMD_FUNC(joblevelup) sd->status.skill_point = 0; else sd->status.skill_point -= level; - clif->displaymessage(fd, msg_txt(25)); // Job level lowered. + clif->message(fd, msg_txt(25)); // Job level lowered. } sd->status.job_exp = 0; clif->updatestatus(sd, SP_JOBLEVEL); @@ -1440,7 +1447,7 @@ ACMD_FUNC(help) help = config_lookup(&atcommand_config, "help"); if (help == NULL) { - clif->displaymessage(fd, msg_txt(27)); // "Commands help is not available." + clif->message(fd, msg_txt(27)); // "Commands help is not available." return -1; } @@ -1454,20 +1461,20 @@ ACMD_FUNC(help) if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) { sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command" - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } if (!config_setting_lookup_string(help, command_name, &text)) { sprintf(atcmd_output, msg_txt(988), atcommand_symbol, command_name); // There is no help for %c%s. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } sprintf(atcmd_output, msg_txt(989), atcommand_symbol, command_name); // Help for command %c%s: - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); { // Display aliases DBIterator* iter; @@ -1488,12 +1495,12 @@ ACMD_FUNC(help) } dbi_destroy(iter); if (has_aliases) - clif->displaymessage(fd, StringBuf_Value(&buf)); + clif->message(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); } // Display help contents - clif->displaymessage(fd, text); + clif->message(fd, text); return 0; } @@ -1529,7 +1536,7 @@ ACMD_FUNC(pvpoff) nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.pvp) { - clif->displaymessage(fd, msg_txt(160)); // PvP is already Off. + clif->message(fd, msg_txt(160)); // PvP is already Off. return -1; } @@ -1539,7 +1546,7 @@ ACMD_FUNC(pvpoff) clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); - clif->displaymessage(fd, msg_txt(31)); // PvP: Off. + clif->message(fd, msg_txt(31)); // PvP: Off. return 0; } @@ -1565,7 +1572,7 @@ ACMD_FUNC(pvpon) nullpo_retr(-1, sd); if (map[sd->bl.m].flag.pvp) { - clif->displaymessage(fd, msg_txt(161)); // PvP is already On. + clif->message(fd, msg_txt(161)); // PvP is already On. return -1; } @@ -1577,7 +1584,7 @@ ACMD_FUNC(pvpon) map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC); } - clif->displaymessage(fd, msg_txt(32)); // PvP: On. + clif->message(fd, msg_txt(32)); // PvP: On. return 0; } @@ -1590,14 +1597,14 @@ ACMD_FUNC(gvgoff) nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.gvg) { - clif->displaymessage(fd, msg_txt(162)); // GvG is already Off. + clif->message(fd, msg_txt(162)); // GvG is already Off. return -1; } map[sd->bl.m].flag.gvg = 0; clif->map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); - clif->displaymessage(fd, msg_txt(33)); // GvG: Off. + clif->message(fd, msg_txt(33)); // GvG: Off. return 0; } @@ -1610,13 +1617,13 @@ ACMD_FUNC(gvgon) nullpo_retr(-1, sd); if (map[sd->bl.m].flag.gvg) { - clif->displaymessage(fd, msg_txt(163)); // GvG is already On. + clif->message(fd, msg_txt(163)); // GvG is already On. return -1; } map[sd->bl.m].flag.gvg = 1; clif->map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE); - clif->displaymessage(fd, msg_txt(34)); // GvG: On. + clif->message(fd, msg_txt(34)); // GvG: On. return 0; } @@ -1634,7 +1641,7 @@ ACMD_FUNC(model) if (!message || !*message || sscanf(message, "%d %d %d", &hair_style, &hair_color, &cloth_color) < 1) { sprintf(atcmd_output, msg_txt(991), // Please enter at least one value (usage: @model ). MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } @@ -1644,9 +1651,9 @@ ACMD_FUNC(model) pc_changelook(sd, LOOK_HAIR, hair_style); pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif->displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1665,15 +1672,15 @@ ACMD_FUNC(dye) if (!message || !*message || sscanf(message, "%d", &cloth_color) < 1) { sprintf(atcmd_output, msg_txt(992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor ). - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif->displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1692,15 +1699,15 @@ ACMD_FUNC(hair_style) if (!message || !*message || sscanf(message, "%d", &hair_style) < 1) { sprintf(atcmd_output, msg_txt(993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle ). - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) { pc_changelook(sd, LOOK_HAIR, hair_style); - clif->displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1719,15 +1726,15 @@ ACMD_FUNC(hair_color) if (!message || !*message || sscanf(message, "%d", &hair_color) < 1) { sprintf(atcmd_output, msg_txt(994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor ). - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) { pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); - clif->displaymessage(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearence changed. } else { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } @@ -1793,7 +1800,7 @@ ACMD_FUNC(go) nullpo_retr(-1, sd); if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) { - clif->displaymessage(sd->fd,msg_txt(995)); // You cannot use @go on this map. + clif->message(sd->fd,msg_txt(995)); // You cannot use @go on this map. return 0; } @@ -1810,11 +1817,11 @@ ACMD_FUNC(go) // attempt to find the text help string text = atcommand_help_string( command ); - clif->displaymessage(fd, msg_txt(38)); // Invalid location number, or name. + clif->message(fd, msg_txt(38)); // Invalid location number, or name. if( text ) {// send the text to the client - clif->displaymessage( fd, text ); + clif->message( fd, text ); } return -1; @@ -1913,21 +1920,21 @@ ACMD_FUNC(go) { m = map_mapname2mapid(data[town].map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(247)); + clif->message(fd, msg_txt(247)); return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(248)); + clif->message(fd, msg_txt(248)); return -1; } if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == 0) { - clif->displaymessage(fd, msg_txt(0)); // Warped. + clif->message(fd, msg_txt(0)); // Warped. } else { - clif->displaymessage(fd, msg_txt(1)); // Map not found. + clif->message(fd, msg_txt(1)); // Map not found. return -1; } } else { // if you arrive here, you have an error in town variable when reading of names - clif->displaymessage(fd, msg_txt(38)); // Invalid location number or name. + clif->message(fd, msg_txt(38)); // Invalid location number or name. return -1; } @@ -1955,7 +1962,7 @@ ACMD_FUNC(monster) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(80)); // Give the display name or monster name/id please. + clif->message(fd, msg_txt(80)); // Give the display name or monster name/id please. return -1; } if (sscanf(message, "\"%23[^\"]\" %23s %d", name, monster, &number) > 1 || @@ -1971,7 +1978,7 @@ ACMD_FUNC(monster) //As before, name may be already filled. name[0] = '\0'; } else { - clif->displaymessage(fd, msg_txt(80)); // Give a display name and monster name/id please. + clif->message(fd, msg_txt(80)); // Give a display name and monster name/id please. return -1; } @@ -1979,12 +1986,12 @@ ACMD_FUNC(monster) mob_id = mobdb_checkid(atoi(monster)); if (mob_id == 0) { - clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. + clif->message(fd, msg_txt(40)); // Invalid monster ID or name. return -1; } if (mob_id == MOBID_EMPERIUM) { - clif->displaymessage(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned. + clif->message(fd, msg_txt(83)); // Monster 'Emperium' cannot be spawned. return -1; } @@ -2018,13 +2025,13 @@ ACMD_FUNC(monster) if (count != 0) if (number == count) - clif->displaymessage(fd, msg_txt(39)); // All monster summoned! + clif->message(fd, msg_txt(39)); // All monster summoned! else { sprintf(atcmd_output, msg_txt(240), count); // %d monster(s) summoned! - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } else { - clif->displaymessage(fd, msg_txt(40)); // Invalid monster ID or name. + clif->message(fd, msg_txt(40)); // Invalid monster ID or name. return -1; } @@ -2071,7 +2078,7 @@ ACMD_FUNC(killmonster) map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); - clif->displaymessage(fd, msg_txt(165)); // All monsters killed! + clif->message(fd, msg_txt(165)); // All monsters killed! return 0; } @@ -2088,27 +2095,27 @@ ACMD_FUNC(refine) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d %d", &position, &refine) < 2) { - clif->displaymessage(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <+/- amount>). + clif->message(fd, msg_txt(996)); // Please enter a position and an amount (usage: @refine <+/- amount>). sprintf(atcmd_output, msg_txt(997), EQP_HEAD_LOW); // %d: Lower Headgear - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(998), EQP_HAND_R); // %d: Right Hand - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(999), EQP_GARMENT); // %d: Garment - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1000), EQP_ACC_L); // %d: Left Accessory - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1001), EQP_ARMOR); // %d: Body Armor - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1002), EQP_HAND_L); // %d: Left Hand - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1003), EQP_SHOES); // %d: Shoes - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1004), EQP_ACC_R); // %d: Right Accessory - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1005), EQP_HEAD_TOP); // %d: Top Headgear - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1006), EQP_HEAD_MID); // %d: Mid Headgear - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } @@ -2143,12 +2150,12 @@ ACMD_FUNC(refine) } if (count == 0) - clif->displaymessage(fd, msg_txt(166)); // No item has been refined. + clif->message(fd, msg_txt(166)); // No item has been refined. else if (count == 1) - clif->displaymessage(fd, msg_txt(167)); // 1 item has been refined. + clif->message(fd, msg_txt(167)); // 1 item has been refined. else { sprintf(atcmd_output, msg_txt(168), count); // %d items have been refined. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -2172,13 +2179,13 @@ ACMD_FUNC(produce) sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 && sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1 )) { - clif->displaymessage(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <# of very's>). + clif->message(fd, msg_txt(1007)); // Please enter at least one item name/ID (usage: @produce <# of very's>). return -1; } if ( (item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL ) { - clif->displaymessage(fd, msg_txt(170)); //This item is not an equipment. + clif->message(fd, msg_txt(170)); //This item is not an equipment. return -1; } @@ -2206,7 +2213,7 @@ ACMD_FUNC(produce) clif->additem(sd, 0, 0, flag); } else { sprintf(atcmd_output, msg_txt(169), item_id, item_data->name); // The item (%d: '%s') is not equipable. - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } @@ -2226,14 +2233,14 @@ ACMD_FUNC(memo) if( !message || !*message || sscanf(message, "%d", &position) < 1 ) { int i; - clif->displaymessage(sd->fd, msg_txt(668)); + clif->message(sd->fd, msg_txt(668)); for( i = 0; i < MAX_MEMOPOINTS; i++ ) { if( sd->status.memo_point[i].map ) sprintf(atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y); else sprintf(atcmd_output, msg_txt(171), i); // %d - void - clif->displaymessage(sd->fd, atcmd_output); + clif->message(sd->fd, atcmd_output); } return 0; } @@ -2241,7 +2248,7 @@ ACMD_FUNC(memo) if( position < 0 || position >= MAX_MEMOPOINTS ) { sprintf(atcmd_output, msg_txt(1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo ). - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return -1; } @@ -2268,7 +2275,7 @@ ACMD_FUNC(gat) map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE)); - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); } return 0; @@ -2283,7 +2290,7 @@ ACMD_FUNC(displaystatus) nullpo_retr(-1, sd); if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) { - clif->displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). + clif->message(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). return -1; } if (i < 2) flag = 1; @@ -2303,7 +2310,7 @@ ACMD_FUNC(statuspoint) unsigned int new_status_point; if (!message || !*message || (point = atoi(message)) == 0) { - clif->displaymessage(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint ). + clif->message(fd, msg_txt(1010)); // Please enter a number (usage: @stpoint ). return -1; } @@ -2330,12 +2337,12 @@ ACMD_FUNC(statuspoint) if (new_status_point != sd->status.status_point) { sd->status.status_point = new_status_point; clif->updatestatus(sd, SP_STATUSPOINT); - clif->displaymessage(fd, msg_txt(174)); // Number of status points changed. + clif->message(fd, msg_txt(174)); // Number of status points changed. } else { if (point < 0) - clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->message(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2352,7 +2359,7 @@ ACMD_FUNC(skillpoint) nullpo_retr(-1, sd); if (!message || !*message || (point = atoi(message)) == 0) { - clif->displaymessage(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint ). + clif->message(fd, msg_txt(1011)); // Please enter a number (usage: @skpoint ). return -1; } @@ -2379,12 +2386,12 @@ ACMD_FUNC(skillpoint) if (new_skill_point != sd->status.skill_point) { sd->status.skill_point = new_skill_point; clif->updatestatus(sd, SP_SKILLPOINT); - clif->displaymessage(fd, msg_txt(175)); // Number of skill points changed. + clif->message(fd, msg_txt(175)); // Number of skill points changed. } else { if (point < 0) - clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->message(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2400,20 +2407,20 @@ ACMD_FUNC(zeny) nullpo_retr(-1, sd); if (!message || !*message || (zeny = atoi(message)) == 0) { - clif->displaymessage(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny ). + clif->message(fd, msg_txt(1012)); // Please enter an amount (usage: @zeny ). return -1; } if(zeny > 0){ if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1) - clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->message(fd, msg_txt(149)); // Unable to increase the number/value. } else { if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny; if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1) - clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. } - if(!ret) clif->displaymessage(fd, msg_txt(176)); //ret=0 mean cmd success + if(!ret) clif->message(fd, msg_txt(176)); //ret=0 mean cmd success return 0; } @@ -2431,14 +2438,14 @@ ACMD_FUNC(param) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) { - clif->displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). + clif->message(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 ); if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible... - clif->displaymessage(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). + clif->message(fd, msg_txt(1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } @@ -2467,12 +2474,12 @@ ACMD_FUNC(param) clif->updatestatus(sd, SP_STR + i); clif->updatestatus(sd, SP_USTR + i); status_calc_pc(sd, 0); - clif->displaymessage(fd, msg_txt(42)); // Stat changed. + clif->message(fd, msg_txt(42)); // Stat changed. } else { if (value < 0) - clif->displaymessage(fd, msg_txt(41)); // Unable to decrease the number/value. + clif->message(fd, msg_txt(41)); // Unable to decrease the number/value. else - clif->displaymessage(fd, msg_txt(149)); // Unable to increase the number/value. + clif->message(fd, msg_txt(149)); // Unable to increase the number/value. return -1; } @@ -2526,12 +2533,12 @@ ACMD_FUNC(stat_all) if (count > 0) { // if at least 1 stat modified status_calc_pc(sd, 0); - clif->displaymessage(fd, msg_txt(84)); // All stats changed! + clif->message(fd, msg_txt(84)); // All stats changed! } else { if (value < 0) - clif->displaymessage(fd, msg_txt(177)); // You cannot decrease that stat anymore. + clif->message(fd, msg_txt(177)); // You cannot decrease that stat anymore. else - clif->displaymessage(fd, msg_txt(178)); // You cannot increase that stat anymore. + clif->message(fd, msg_txt(178)); // You cannot increase that stat anymore. return -1; } @@ -2549,16 +2556,16 @@ ACMD_FUNC(guildlevelup) nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%d", &level) < 1 || level == 0) { - clif->displaymessage(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>). + clif->message(fd, msg_txt(1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>). return -1; } - if (sd->status.guild_id <= 0 || (guild_info = guild_search(sd->status.guild_id)) == NULL) { - clif->displaymessage(fd, msg_txt(43)); // You're not in a guild. + if (sd->status.guild_id <= 0 || (guild_info = sd->guild) == NULL) { + clif->message(fd, msg_txt(43)); // You're not in a guild. return -1; } //if (strcmp(sd->status.name, guild_info->master) != 0) { - // clif->displaymessage(fd, msg_txt(44)); // You're not the master of your guild. + // clif->message(fd, msg_txt(44)); // You're not the master of your guild. // return -1; //} @@ -2570,9 +2577,9 @@ ACMD_FUNC(guildlevelup) if (added_level != 0) { intif_guild_change_basicinfo(guild_info->guild_id, GBI_GUILDLV, &added_level, sizeof(added_level)); - clif->displaymessage(fd, msg_txt(179)); // Guild level changed. + clif->message(fd, msg_txt(179)); // Guild level changed. } else { - clif->displaymessage(fd, msg_txt(45)); // Guild level change failed. + clif->message(fd, msg_txt(45)); // Guild level change failed. return -1; } @@ -2589,7 +2596,7 @@ ACMD_FUNC(makeegg) nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg ). + clif->message(fd, msg_txt(1015)); // Please enter a monster/egg name/ID (usage: @makeegg ). return -1; } @@ -2612,7 +2619,7 @@ ACMD_FUNC(makeegg) (short)pet_db[pet_id].EggID, 0, (short)pet_db[pet_id].intimate, 100, 0, 1, pet_db[pet_id].jname); } else { - clif->displaymessage(fd, msg_txt(180)); // The monster/egg name/id doesn't exist. + clif->message(fd, msg_txt(180)); // The monster/egg name/id doesn't exist. return -1; } @@ -2628,7 +2635,7 @@ ACMD_FUNC(hatch) if (sd->status.pet_id <= 0) clif->sendegg(sd); else { - clif->displaymessage(fd, msg_txt(181)); // You already have a pet. + clif->message(fd, msg_txt(181)); // You already have a pet. return -1; } @@ -2645,30 +2652,30 @@ ACMD_FUNC(petfriendly) nullpo_retr(-1, sd); if (!message || !*message || (friendly = atoi(message)) < 0) { - clif->displaymessage(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>). + clif->message(fd, msg_txt(1016)); // Please enter a valid value (usage: @petfriendly <0-1000>). return -1; } pd = sd->pd; if (!pd) { - clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif->message(fd, msg_txt(184)); // Sorry, but you have no pet. return -1; } if (friendly < 0 || friendly > 1000) { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } if (friendly == pd->pet.intimate) { - clif->displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum. + clif->message(fd, msg_txt(183)); // Pet intimacy is already at maximum. return -1; } pet_set_intimate(pd, friendly); clif->send_petstatus(sd); - clif->displaymessage(fd, msg_txt(182)); // Pet intimacy changed. + clif->message(fd, msg_txt(182)); // Pet intimacy changed. return 0; } @@ -2682,27 +2689,27 @@ ACMD_FUNC(pethungry) nullpo_retr(-1, sd); if (!message || !*message || (hungry = atoi(message)) < 0) { - clif->displaymessage(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>). + clif->message(fd, msg_txt(1017)); // Please enter a valid number (usage: @pethungry <0-100>). return -1; } pd = sd->pd; if (!sd->status.pet_id || !pd) { - clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif->message(fd, msg_txt(184)); // Sorry, but you have no pet. return -1; } if (hungry < 0 || hungry > 100) { - clif->displaymessage(fd, msg_txt(37)); // An invalid number was specified. + clif->message(fd, msg_txt(37)); // An invalid number was specified. return -1; } if (hungry == pd->pet.hungry) { - clif->displaymessage(fd, msg_txt(186)); // Pet hunger is already at maximum. + clif->message(fd, msg_txt(186)); // Pet hunger is already at maximum. return -1; } pd->pet.hungry = hungry; clif->send_petstatus(sd); - clif->displaymessage(fd, msg_txt(185)); // Pet hunger changed. + clif->message(fd, msg_txt(185)); // Pet hunger changed. return 0; } @@ -2715,19 +2722,19 @@ ACMD_FUNC(petrename) struct pet_data *pd; nullpo_retr(-1, sd); if (!sd->status.pet_id || !sd->pd) { - clif->displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. + clif->message(fd, msg_txt(184)); // Sorry, but you have no pet. return -1; } pd = sd->pd; if (!pd->pet.rename_flag) { - clif->displaymessage(fd, msg_txt(188)); // You can already rename your pet. + clif->message(fd, msg_txt(188)); // You can already rename your pet. return -1; } pd->pet.rename_flag = 0; intif_save_petdata(sd->status.account_id, &pd->pet); clif->send_petstatus(sd); - clif->displaymessage(fd, msg_txt(187)); // You can now rename your pet. + clif->message(fd, msg_txt(187)); // You can now rename your pet. return 0; } @@ -2741,28 +2748,28 @@ ACMD_FUNC(recall) { nullpo_retr(-1, sd); if (!message || !*message) { - clif->displaymessage(fd, msg_txt(1018)); // Please enter a player name (usage: @recall ). + clif->message(fd, msg_txt(1018)); // Please enter a player name (usage: @recall ). return -1; } if((pl_sd=map_nick2sd((char *)message)) == NULL && (pl_sd=map_charid2sd(atoi(message))) == NULL) { - clif->displaymessage(fd, msg_txt(3)); // Character not found. + clif->message(fd, msg_txt(3)); // Character not found. return -1; } if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { - clif->displaymessage(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player. + clif->message(fd, msg_txt(81)); // Your GM level doesn't authorize you to preform this action on the specified player. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(1019)); // You are not authorized to warp someone to this map. + clif->message(fd, msg_txt(1019)); // You are not authorized to warp someone to this map. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->displaymessage(fd, msg_txt(1020)); // You are not authorized to warp this player from their map. + clif->message(fd, msg_txt(1020)); // You are not authorized to warp this player from their map. return -1; } if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) { @@ -2770,7 +2777,7 @@ ACMD_FUNC(recall) { } pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN); sprintf(atcmd_output, msg_txt(46), pl_sd->status.name); // %s recalled! - clif->displaymessage(fd, atcmd_output); + clif->message(fd, atcmd_output); return 0; } @@ -2786,12 +2793,12 @@ ACMD_FUNC(char_block) memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { - clif->displaymessage(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block ). + clif->message(fd, msg_txt(1021)); // Please enter a player name (usage: @charblock/@block ). return -1; } chrif_char_ask_name(sd->status.account_id, atcmd_player_name, 1, 0, 0, 0, 0, 0, 0); // type: 1 - block - clif->displaymessage(fd, msg_txt(88)); // Character name sent to char-server to ask it. + clif->message(fd, msg_txt(88)); // Character name sent to char-server to ask it. return 0; } @@ -2823,7 +2830,7 @@ ACMD_FUNC(char_ban) memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) { - clif->displaymessage(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish