summaryrefslogtreecommitdiff
path: root/src/map/mob.c
AgeCommit message (Collapse)AuthorFilesLines
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
2006-05-24- Corrected mob angry mode, now it only "restores" itself after being hit ↵skotlex1-4/+3
when the mob has no target within their range of sight rather than on picking a new target. - Corrected a pair of incorrect sql query parsing logic in the login-sql ban request packet. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6724 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23- Corrected clif parse name request failing on disguised characters.skotlex1-1/+2
- Corrected Soul Drain draining from all non-ground-based skills including non-magic attacks. - Corrected pc_setoption to change the option and then change class. changing option-wedding will automatically convert the view-class as well. - Corrected the 15% drop rate increase when killing higher level mobs in pk-mode triggering for all mobs with lower level than yourself. Thanks to Vayu. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6709 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22- Corrected the 20 lvl diff 15% exp bonus on pk_mode servers. Thanks to Vayu ↵skotlex1-1/+2
for pointing it out. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6698 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-19- Fixed loginlog definition in main.sql, thanks to Tempestaskotlex1-3/+3
- Likely fixed the mob-skill random picking behaviour causing infinite loops sometimes. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6658 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-19- Added some braces to clear up the code in pc_additem, even though I doubt ↵skotlex1-6/+12
it'll fix the problem :X - Modified mobskill_use behaviour to pick a random starting point and check skills from that, rather than always checking from first to last. Fixes skills with high priority blocking skills lower down in the list from triggering. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6657 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-19- Updated mob ai behaviour so that mobs use IDLE state skills when their ↵skotlex1-4/+9
current target cannot be reached for melee fighting. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6655 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-17- Modified mob_can_changetarget to return true always when the new target is ↵skotlex1-3/+7
the provoked-by character. Fixes provoke not making the mob change target when it already is locked on another player. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6633 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-15- Changed the behaviour of immobile mobs when they can't chase their target. ↵skotlex1-1/+2
Rather than using a longrange skill and then unlocking, they will use an attack/angry state skill and then unlock. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6599 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-14data.x=x; data.y=y was not done at all except when using random coordinates. ↵blackhole891-2/+5
dfhsdfhsdfh git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-12- Reverted again the change that stuns the caster on Ske, Ska, Swoo when the ↵skotlex1-9/+15
target is a nonplayer (rather than always) - Modified mob_spawn_once so that coordinates -1,-1 are "random around the player" while 0,0 are random around the whole map (regardless of whether there's a player attached or not) - Knockback will no longer work on traps during woe. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6566 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-12- Updated cast times of Kaupe and Kaahi.skotlex1-3/+2
- Some small code cleanups. - Sma has cast-dex reducable now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6564 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-11- NPC_POWERUP and NPC_AGIUP now cause a increase in hit/flee (respectively) ↵skotlex1-1/+1
of 40% per level. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6558 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-09- Fixed Fog of Wall's symmetry in respect to Misc attacks, they no longer ↵skotlex1-4/+2
get reduced by 50% regardless of who is standing on the fog. - monster_ai&2 will now trigger the rude-attacked skill when the mob can't move and the attacker is out of it's attack range. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6536 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-09- Added missing icon for Joint Beatskotlex1-2/+6
- Mob-search functions will now skip enemies with no exp/job_exp. - Treasure chests will now be excluded from the mob-drop listings (@whodrops) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6534 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-09- Script commands sc_start, sc_start2 and sc_start4 will now start ↵skotlex1-3/+7
regardless of sc defense of the target player (that is, they cannot be avoided) - Fixed a possible counter overflow in attacked_count, changed the var size to unsigned char since the code can handle the overflow now. - Multiple targets again reduces armor defense, as reported by Tharis. - Increased dex increase of NPC_POWERUP to +20 per level. - Fog of Wall's -50 hit reduction is now only for ranged attacks. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6528 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-07removed old logsLupus1-13/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6510 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-05- Added a npc-script-event cache to avoid looking up event-scripts every ↵skotlex1-14/+3
time they need to be executed. Events cached are all those defined in script_config. - Since the cache holds direct pointers to the npcs/events, do NOT unload the related NPCs or you'll get dangling pointers. However, @reloadscript will work fine. - Set the etc_log to on to see a summary of npcs/events loaded for script execution on startup. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6494 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-05- Being in Enjoyable Rest state will now also trigger the HP/SP Time skills ↵skotlex1-0/+16
(even if there's no other TK around). - Renamed SC_TKDORI to SC_TKREST (makes more sense if you ask me) - Added battle config settings view_range_rate and chase_range_rate to adjust the view-range and chase-range (range2/range3) of the mob_db without having to manually change them. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6490 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-05fixed my MVP drop confreddozen1-10/+10
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6481 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-04- Some clean-ups in the mob_aiskotlex1-6/+8
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6478 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-04- Cleaned up and used mob_skill_event function when hit by a ground-skill.skotlex1-1/+1
- Added one grace range in the mob_loot search function which should fix mob_can_reach failing when invoked with the same distance that distance_bl returned. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6475 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-04- Cleaned up the mob-random-walking code.skotlex1-42/+37
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6468 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-04- Pair of almost insignificant changes in mob.c (removed a unneeded ↵skotlex1-2/+1
next_walktime set on loot-lock and usage of range2 rather than 3 for min_chase when locking an "attacked by" target) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6464 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-02added support to regulate MVP drops [Reddozen]reddozen1-15/+55
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6439 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-30- Removed attack_type from sd->state structure (it's only use was for ↵skotlex1-7/+1
soul-drain!) - Moved the soul-drain code to skill_counter_additionaleffect git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6392 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-30- Fixed possible crash when mob drop logs is enabled. skotlex1-1/+1
- The drop log tables are useless now that mobs have more slots, that thing needs to be rewritten... git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6391 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-29- Modified the mob_db structure. The mvp related columns were moved to ↵skotlex1-85/+84
before the drops, amount of drops increased from 10 to 15. - Updated sql-files/mob_db.sql to latest. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6354 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-28- Added constant MAX_MOB_DROP to specify the amount of normal drops a mob ↵skotlex1-15/+20
has. The mob_db reading code will automatically parse the file according to the number of drops expected (the Mexp/Mper and MVP item rewards must still be after the normal drops). Set to 10 currently. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6347 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-28- Added function stristr to strlib.c, used by mob.c and item_db.c for ↵skotlex1-2/+3
case-insensitive seeks. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6345 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-28- Added unlocking ud.target on mob_unlocktarget, fixes mobs chasing you ↵skotlex1-0/+1
around while cloaked. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6333 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-27- Changed the default rate of clone mob skills to 5% modified by ↵skotlex1-1/+1
mob_skill_rate setting. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6332 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-27- Some changes in the slave skill conditions. All their skills are triggered ↵skotlex1-11/+8
at a 10% chance now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6322 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-27- Fixed unit_attack_timer mismatch warnings (this was solved yesterday, but ↵skotlex1-1/+0
I forgot to apply the fix to trunk) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6306 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-26- Modified mob_drop_adjust function to receive unsigned int as initial ↵skotlex1-3/+5
parameter, should give a bit more room before data overflows. - Increased range check for Extremity to 2. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6297 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-25- Modified and simplified the random item group format. It now is ↵skotlex1-2/+2
<GroupID>,<ItemID>,<Rate>, where Rate normally is 1, greater numbers is the equivalent of adding the line multiple times. - Added constants to identify all groups to db/const.txt - Cleaned up and updated item_db to use these new constants (warning: item_db.sql needs to be updated!) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6275 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-25- All GMs will be sent to the char server through packet 0x2aff now.skotlex1-2/+1
- Made mob_searchname compare versus sprite, name and jname now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6263 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-24- Cleaned up @grind2skotlex1-2/+2
- Updated @monsterbig, @monstersmall to use the event 2 and 4 rather than the max_mob_db code check. - Modified override_mobs_names to work only on the mob spawn files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6252 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-24- Fixed skill_delayfix not altering delay at all after you reached 150.skotlex1-22/+8
- Applied ers to pet loot drops. - Cleaned up the pet loot drop function. - Mob skill state MSS_ANY won't include MSS_DEAD now. - Added mob skill state MSS_ANYTARGET ("anytarget") which means any state (except dead) on which the mob has a target set. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6250 54d463be-8e91-2dee-dedb-b68131a5f0ec