summaryrefslogtreecommitdiff
path: root/src/map/mob.c
AgeCommit message (Collapse)AuthorFilesLines
2006-06-19- Moved back Soul Drain code from mob_dead to ↵skotlex1-8/+0
skill_counter_additional_effect. Now we are back to where the skill animation does not shows, but you DO get SP T.T' (fixing this is turning out so difficult...) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7253 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-18- Fix for #102547Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7235 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-18* [Removed]: Lance1-1/+0
- Large part of scripted mob control commands are removed. - Large part of scripted player control commands are removed. - Scripted mob slaves changing master ID. [Added]: - Unit control commands. - CALLBACK_NPCCLICK for scripted mobs, added this to db/const.txt too. - Macro RECURSIVE_MASTER_CHECK in battle.c [Modified]: - buildin_skilluseid and buildin_skillusepos -> buildin_unitskilluseid and buildin_unitskillusepos. - md->callback_flag to short (double word). [Lance] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7233 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-17* [Added]: Lance1-4/+4
- buildin_checkcell, buildin_mobwarp, buildin_pcattack. * [Improved]: - buildin_skilluseid and buildin_skillusepos to accept a few more arguments. - mob_script_callback to return sucess value. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7219 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16- Removed unused variable aspd_rate in map_session_data.skotlex1-2/+2
- Modified aspd_rate in status_data to hold aspd change on a base of 1000 = 100% rather than 100 = 100%. All status changes that affect aspd have been updated. Study and Single Action should now correctly give +0.5% aspd per level. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7213 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16- Whoops, fixed compilation issue on mob_dead.skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7210 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16- Removed db_tables.sql as it's no longer used.skotlex1-0/+5
- the mvp_sd is removed when the mob is the emperium and there's no killer/exp-awarded (assumed killed by script), this prevents the on-kill event from triggering and giving the castle to whoever damaged the most the emperium without destroying it. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7208 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16- Removed return from CALLBACK_ASSISTLance1-3/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7205 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7204 ↵Lance1-0/+1
54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16* [Improved]: Lance1-39/+29
- Cleaned up Custom Mob Script Callback codes. Looks much better now :B. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7202 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-10- Added structure party_data and party_member_data to the map server to hold ↵skotlex1-2/+2
party-specific required information about parties including Monk/TK/SG/SN states and party member count. - party Hp updates are no longer done each time the Hp is modified, but together with the party xy timer. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7083 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-08git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7045 ↵Lance1-1/+4
54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07- Fixed the mob state not being set to Berserk/Angry correctly after the mob ↵skotlex1-0/+4
reaches the target's location. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7040 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07- Added config setting mob_npc_warp, when set to yes, enables mobs to be ↵skotlex1-1/+24
warped between maps when stepping on a npc-warp. - Added monster_ai setting &64, when enabled makes a mob run to any nearby npc-warp when their current target has switched maps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7039 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07- Added pc_calcexp to calculate individual exp bonuses acquired from exp's ↵skotlex1-20/+4
source (race bonus cards, SG Exp skills, pk-mode higher level exp) - pc_gain_exp now also receives the source of the exp, when said source exists, bonuses are applicated as needed. - Added status_kill when capturing a mob, should take care of the mob not respawning after caputed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7037 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07- Moved souldrain code from skill_counter_additional_effect to mob_dead. It ↵skotlex1-0/+8
should display the skill animation correctly now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7033 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07- Solved an ambiguous if in mob_dead.skotlex1-1/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7026 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07* [Improved]:Lance1-3/+7
- mob_dead not to remove script controlled monsters with player sprites. (can be removed later using removemob command, it can be resurrected too :D) * [Added]: - buildin_mobdeadsit :D git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7024 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07* [Fixed]:Lance1-1/+2
- temp++ gets issued before if(mvp_damage<(unsigned int)md->dmglog[i].dmg) in mob_damage. Thanks to seahorsix. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7023 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-06- Some cleaning of mob_damage, added a default case when attacked to ↵skotlex1-13/+16
retaliate to whatever attacked the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7017 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-06- The monsters can level up setting will not take effect when the mob's ↵skotlex1-2/+2
level is LESS than their db counter-part (should prevent under-leveling causing underflows and semi-immortal mobs) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7005 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-06- cleaned up status_check_skilluse some to use status_data variables.skotlex1-9/+8
- Fixed mvp-exp calculations being messed up with more than one attacker. - Changed the mob exp race bonus so that each player gets their own bonus, rather than the killer's bonus applying to everyone. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7003 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-05- Fixed a crash when using SL_SMA and the "combo" ain't ready.skotlex1-1/+2
- Hopefully fixed changing a mob's class causing them to get all sort of stat bonuses due to the mobs-level-up setting. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6994 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-05- Fog of Wall won't affect the caster now in any way.skotlex1-0/+2
- Added a missing status_calc_mob on mob_spawn_guardian_sub - Added clif_fixpos packets before attacking for the first time to clear any position sync issues with the client. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6985 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-02- Some cleaning of the mob slave ai. skotlex1-15/+9
- Moved MOB_SLAVEDISTANCE to mob.h - NPC_CALLSLAVES now uses the slave-distance previously mentioned. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6940 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-02- Moved setting a mob's level from mob_spawn to status_calc_mob, resetting ↵skotlex1-4/+0
their level on death has also been removed (as it is handled now on spawn) - Fixed a bug in status_revive - Updated Holy Cross, Investigate and Finger Offensive to be usable by all weapons. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6938 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-02git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6927 ↵Lance1-1/+1
54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-02[Fixed] Lance1-1/+1
- Yet another compilation warning. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6924 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-01- Corrected setting slaves_inherit_mode to not apply to morphosis skills.skotlex1-1/+1
- Added define OPTION_CART which holds the 5 cart option values. - Corrected pc_setoption to invoke status_calc_pc when getting/removing the cart. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6914 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-01- Fixed slaves warping endlessly to their master when the master-slave ↵skotlex1-1/+3
distance exceeds 30. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6909 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-01- Some small cleanups on status_calc_petskotlex1-1/+1
- Fixed one valgrind error report. - Added back the Freeze/Petrify adjustments of -50%def and +25%mdef (when where these lost?) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6903 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31- Corrected the mob_ai&2 setting triggering rude-attacked due to can't walk ↵skotlex1-2/+3
delay. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30- Updated attr_fix_table reading code to account for ELE_MAX (will correctly ↵skotlex1-4/+24
read bigger elemental tables if ELE_MAX is changed) - Aggressive mobs will now use battle_check_range rather than mob_can_reach to decide whether to lock-on or not to a target within sight-range. - Added warnings in mob_readdb when the mob's element is invalid. - Updated the corresponding entries in map.h to use ELE_MAX - Added error messages in pc_bonus* functions when an invalid element is passed to the relevant bonuses. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6856 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30- Removed the on-die specific code from unit_remove_map and placed it on the ↵skotlex1-17/+20
corresponding *_dead functions. unit_remove_map should never assume the char died, it is just a "remove from map" function. - Updated status_damage to handle the general death code (clearing status changes, clearing skill related data, sending death packet, etc). The return value from the *_dead functions will tell it what to do or not with the object (death aborted, clear it from map/memory, etc) - Cleaned up pc_dead to take advantage of the fact that status changes are not ended until after the function. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6852 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30Added decending npc to slaves. Custom feature.. nothing much.Lance1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6849 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30[Fixed] Lance1-1/+1
- Typo in mob_dead causing crash. Thanks to reddozen and his gang for testing. - Compilation warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6835 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29- Fixed pc_gainexp resetting your exp to 0 rather than adding it in... -.-skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6828 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29- Added a division by zero check in mob_dead to prevent the (impossible) ↵skotlex1-3/+5
case where a mob dies with received damage of zero. - Fixed compilation errors with SC_FLING... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6821 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28- Added functions status_revive, pc_revive and mob_revive to handle revival ↵skotlex1-21/+26
(it doesn't handles player respawning, though) - Corrected alive, raisemap, raiseall to use these functions. - Updated resurrection/mob-kaizel to use status_revive - Added SC_BLADESTOP to the skill enum at the beginning of status.c (fixes Bladestop causing an unknown status change message) - Fixed MSS_DEAD state skills not triggering. - Corrected some compilation warnings on the merc.* files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6807 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28- Suppressed compilation warnings (unsigned and signed mismatches)Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6793 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-27- Added structure status_data which holds status-related information (str, ↵skotlex1-4131/+4065
agi, etc, speed, amotion, adelay, dmotion, weapon-damage, race, size, etc) and weapon_atk structure with the weapon specific info (atk, atk2, element) to be used by all combat structures (TODO: Homun needs to be updated to use it) - Cleaned up TBL_PC, TBL_MOB, TBL_PC and mob_db structures to use status_data. - Set the NPC-Change Attribute duration on Time1, updated their max to 1 in the db. - Berserk's HP cost interval is now defined as time2. - Split damage received functions into pc_damage/pc_dead and mob_damage/mob_dead - Rewrote the @heal related functions to use the new status_* healing functions. - Added status functions to deal with damage and healing (status_damage, status_heal, status_percent_change) and a bunch of defines for easier handling of them (status_percent_heal, status_percent_damage, status_fix_damage, status_kill, etc) - Splitted mob_once_spawn into two. mob_once_spawn_sub creates the mob instance without spawning it. - Added defines for Elements (ELE_*) - Modified battle_calc_(weapon/magic/misc)_attack to use the status data structure. - Rewrote and cleaned up battle_calc_misc_attack - Merged config options pc_attack_attr_none, mob_attack_attr_none, pet_attack_attr_none into attack_attr_none (type 4) - Removed config options player_defense_type, monster_defense_type, pet_defense_type in favor of weapon_defense_type - Cleaned up pet.c to stop invoking status_calc_pc when unnecessary - Modified skill_calc_heal to take into account the MEDITATION bonus. - Cleaned up code of Adjustment, Madness Cancel and other GS/NJ skills inside skill_check_condition - Added status change SC_MODECHANGE which handles mob state changes (this SC is continous until manually ended, eg: like Weight50) - Modified Slim Pitcher so it will work when casted by non-players. Will now also work with SP-healing items. - Rewrote Freedom of Cast code to use function status_freecast_switch to switch adelay/speed when cast begins/ends. - Modified Magic Power to store amplified MATK/MATK2 in val3/val4 for easier updating when used in conjunction with ground skills. - Fixed Asura Strike being usable from within a combo regardless of combo skill. - Modifed SC_DANCING to store speed-change in val3 (it is shared with skill duration...) - Added StatusChangeFlagTable to store which statuses are changed by each SC - Added SCB_* constants to specify the different stats that each sc changes. SCB_PC is the only one that means a change hardcoded in status_calc_pc, the rest are handled by status_calc_bl - Added some helper functions to simplify with basic status calculations (status_base_atk, status_calc_misc, status_base_pc_maxhp, status_base_pc_maxsp) - Added status_calc_mob which calculates initial status and special base status alterations (HP changes, stat changes due to big/small mobs, etc) - Made all the status_calc functions static. - Added status_calc_bl_sub_pc for PC related calculations that must happen after status-change adjustments. - Added status_calc_bl which does status-change related calculations using as base the base_status of the bl object and the SCB_* flag passed. - Added status_get_status_data and status_get_base_status to retrieve the bl objects current status_data and basic status_data (current never returns null, instead it returns a dummy structure with basic data) - The main switch in status_change_start now only sets the tick and val values, therefore it is skipped when loading (flag&4) - Cleaned up status_change_start and replaced many of the ex-japanese comments for english ones. - Changed Hiding to store the speed penalty on val3. val4 stores interval SP cost. - Changed Chase Walk to store Speed adjustment on val3, sp cost in val4 - Changed Cloaking to store speed penalty on val3, val4&2 signals wall-present, val4&1 is infinite cloaking. - Changed Wind walk to store speed bonus on val3 - Rewrote Marionette Control to store the status to add/substract in val3/val4, it now works on anyone (players/mobs) - Changed Improve concentration to store Card bonuses (which are not counted for total % increase) on val3/val4 - Changed SC_ADRENALINE, SC_CONCENTRATION, SC_ANGELUS, SC_IMPOSITIO, SC_MELTDOWN, SC_TRUESIGHT, SC_SUN_COMFORT, SC_MOON_COMFORT, SC_STAR_COMFORT, SC_QUAGMIRE, SC_GATLINGFEVER to store the bonus modifiers in their val values rather than calculate them in status_calc_* - Status_change_start/end will use clif_status_load rather than clif_status_change when related bl is not on a map. - Modified status_change_timer to use the status_charge function rather than directly substracting SP - Added SC_ELEMENTALCHANGE to modify someone's base defense element. - pc_clean_skilltree will now also remove item-granted skills. - Learning skills will now only invoke status_calc_pc when the skill is passive. - Cleaned up pc_steal_coin - Cleaned up pc_check_base/job_lvup to only invoke the lv-up related packets and functions ONCE regardless of skill-levls earned. - Cleaned up pc_ regen related functions. - Made player-sprite mobs have item pickup animation and walkdelay when taking items. - Cleaned up mob_dead code. - Removed paramb, parame from struct map_session_data, replaced them by param_bonus[6],param_equip[6] - mob special ai state 3 signals summon flora. - Moved petDB pet_hungry_timer vars from TBL_PC to TBL_PET - Cleaned up some pet functions, made the menu functions receive as argument both pet and master. - Clones will copy a player's base status rather than battle status (so status-change alterations are not cloned) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6791 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26And another possible crashLance1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6783 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26* Fixed crashing in mob.cLance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26* Patches to allow everything to work right. + 1 more sample script.Lance1-1/+21
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26Added a few more events in..Lance1-4/+16
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6776 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26* Mob control engine tested 99% working so far.Lance1-35/+44
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6770 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25* Fixed mob control commands.Lance1-1/+29
* Fixed memory leak in scripts (again). Still have a few lying. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6749 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25* Fix to the slave AI problem, by Skotlexeaac1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6742 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24- Fixed summoned slaves being able to cast onspawn summon-skills (slaves ↵skotlex1-2/+3
aren't supposed to be able to call minions) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6735 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-24- Merged item_db.sql from stable :Bskotlex1-10/+8
- Added a missing line (how did it get lost?) in mob_spawn to set aggressive state for angry mobs. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6731 54d463be-8e91-2dee-dedb-b68131a5f0ec