1879 Commits

Author SHA1 Message Date
skotlex
bce845e94f - Fixed pets ignoring can-act delays for skill usage.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6870 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31 02:31:08 +00:00
Lance
15194233b8 [Improved]:
- loginlog using unsigned long `ip` field. (Please check for compatibility problems). 
[Added]: 
- Mercenary.c in VS.NET 2005 project files

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6868 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31 02:13:23 +00:00
skotlex
8a6609900a - Fixed status_calc_pc not zero'ing ALL vars it should, allowing certain bonuses (like effect-on-hit) to stack.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6867 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31 00:03:18 +00:00
skotlex
1de06a14e4 - Call Slave now invokes slaves on a 5x5 area around master.
- AL_TELEPORT will fail when used by slave mobs.
- Added NPC_ENERGYDRAIN, NPC_MENTALBREAKER to the list of undodgeable attacks.
- slaves inherit speed setting will now work regardless of whether the slave or master has the MD_CANMOVE mode bit.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6865 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 23:45:09 +00:00
skotlex
d90347c73e - Fixed status_damage not setting your HP to 0 when you died T.T
- Fixed the pcbonus2 warnings using the wrong value before printing the invalid Element error.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6864 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 23:10:27 +00:00
skotlex
363db7730b - Added a pair of missing pc_setstand in the pc_dead function.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6861 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 20:53:28 +00:00
skotlex
6192e5a5e5 - Fixed underflow issues when calculating dmotion.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6860 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 20:44:54 +00:00
skotlex
7f776280a5 - Fixed Absorb Spirit Spheres
- Added battle_config min_chat_delay (default 0) specifies in ms what is the min delay between player sent chats (whisper/global/party/guild). Messages that exceed this threshold are silently ignored for now (perhaps need to add a "DON'T SPAM" reply to the player?)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6859 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 19:28:41 +00:00
Lance
9f1f9dacb2 * [Fixed]:
- signed/usigned problem in sprintf and fscanf @ mercenary.c

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6858 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 19:22:14 +00:00
skotlex
ba6216e43e - Rewrote/cleaned up @petfriendly.
- Cleaned up final part of status_calc_pc (flags 2/4 do not exist)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6857 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 18:56:49 +00:00
skotlex
a2f222eb46 - Updated attr_fix_table reading code to account for ELE_MAX (will correctly 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://svn.code.sf.net/p/rathena/svn/trunk@6856 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 18:25:55 +00:00
Lance
e266a08f7c [Optimized]:
- clif_specialeffect to use the enums.
[Improved]: 
- buildin_specialeffect and buildin_specialeffect2 to accept effect area definition.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6855 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 18:13:16 +00:00
Lance
40f2aa9cc5 * [Added]
- Visual Studio .NET 2003 includes for mercenary.c 
* [Fixed]
- Logic error in NPC custom AI in unit.c

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6853 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 17:11:55 +00:00
skotlex
1d027c8db8 - Removed the on-die specific code from unit_remove_map and placed it on the 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://svn.code.sf.net/p/rathena/svn/trunk@6852 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 17:06:55 +00:00
Lance
9516734715 Added decending npc to slaves. Custom feature.. nothing much.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6849 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 15:39:02 +00:00
skotlex
ccdafb2b70 - Fixed sql compilation of mercenary.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6848 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 15:37:43 +00:00
skotlex
1074b09187 - Small optimization in battle_check_target
- Disabled ontouch npcs triggering on hidden/chase-walk characters.
- Added the SC* code blocks relevant to SC_AVOID, SC_CHANGE, SC_BLOODLUST, SC_FLEET
- Added structure status_data to homun_data
- Added handling of BL_HOMUNCULUS in status_heal, status_damage.
- Cleaned up the homun-submitted code, moved the relevant code to status_calc_homunculus.
- Updated map-server Makefile to compile mercenary.* files.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6847 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 15:29:17 +00:00
Lance
25c499e07b (I need sleep)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6845 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 13:23:06 +00:00
Lance
42f64dbd26 Final alteration :P
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 13:22:26 +00:00
Lance
aabab7f7c5 [Corrected]:
- pc.c again (Darn I'm making more mistakes)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 13:19:50 +00:00
Lance
94b0820fda [Fixed]:
pc.c to use unit_stop_attack()

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 13:15:18 +00:00
Lance
21a6d3fad7 * [Fixed]
- Pets attacking even master is dead

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6841 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 13:11:13 +00:00
skotlex
4b668c4e82 - Fixed battle_calc_weapon_attack damage capping damage to a minimum of 0 (negative values should be allowed when attack is absorbed by target's element)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6840 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 12:31:58 +00:00
Lance
471fe5467b [Fixed]
- Battle mechanics in battle_check_target

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6836 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 07:29:10 +00:00
Lance
435f579918 [Fixed]
- Typo in mob_dead causing crash. Thanks to reddozen and his gang for testing.
- Compilation warnings

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6835 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 07:07:59 +00:00
skotlex
c5472ef2b5 - Changed status_heal and status_damage to receive signed int values. They will invoke each other as needed when the passed values are negative.
- Updated battle_calc_attack to set atk type to ATK_FLEE and dmotion to 0 when the damage is less than 1 (missed or absorbed)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6832 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30 04:07:27 +00:00
skotlex
891620bc62 - Cleaned up friend list saving and fixed loading of friends.txt file (char-txt)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6830 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 23:16:51 +00:00
skotlex
d3832b5146 - Fixed pc_gainexp resetting your exp to 0 rather than adding it in... -.-
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6828 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 20:20:42 +00:00
skotlex
38eeb73b96 - Corrected aspd calculation code to avoid negative overflows.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6827 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 20:11:23 +00:00
skotlex
d69e247829 - Updated max_def parameter to not apply to mdef if magic_defense_type is set (rather than weapon_defense_type)
- Updated comment description for config setting max_def
- Fixed battle_check_target check on BCT_ALL to check versus BL_CHAR instead of BL_PC and BL_MOB


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6826 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 18:08:07 +00:00
Lance
7b86a76b94 [Fixed]:
- Declaration of int map_getcellp(struct map_data*,int,int,cell_t);

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6825 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 17:28:26 +00:00
skotlex
1adeac2c7a - Updated ASC_BREAKER's range to 9.
- Removed speed penalty from SC_SKA
- Fixed SC_SPURT triggering on Soul Linkers.
- SC_DODGE won't be dispelled on death now.
- Removed Undead being inmune to poison status.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6823 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 16:36:17 +00:00
Lance
4d5a8c5079 [Fixed]:
- pc_follow_timer possible triggering crash.
- pc_reg_received to use battle_status.hp instead of status.hp
[Added]: 
- macro map_id2index for non-cyptic mapid to mapindex conversion.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6822 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 16:15:48 +00:00
skotlex
048bd9bd8f - Added a division by zero check in mob_dead to prevent the (impossible) case where a mob dies with received damage of zero.
- Fixed compilation errors with SC_FLING...


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6821 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 16:01:02 +00:00
skotlex
dc7581d42d - Modified skill_get_range2 to return range 9 for skills with range 0 for Non-Players. This usually signals Self skills, and mobs/pets should be able to use them in other characters.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6820 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 15:48:43 +00:00
skotlex
8f5c155fb4 - Cleaned up some status_get functions.
- Optimized a bit the SC_PROVOKE code (to use val3/val4)
- Fixed draining when the amount drained is negative (invoke zap rather than heal)
- Implemented GS_FLING as per the current skill description.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6819 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 15:25:28 +00:00
skotlex
ffce913970 - Fixed pc_readparam/pc_setparam to use battle_status.hp/sp rather than status.hp/sp, fixes scripts reading the wrong Hp/Sp values
- Added some missing SC_* entries on the initial listing (potion related and speed up ones)
- Fixed function declaration of map_getcellp()


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6817 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 14:10:22 +00:00
Lance
559987d438 * [Fixed]:
- status.c:920: warning: 'mbl' might be used uninitialized in this function 
- skill.c:6648: warning: 'matk_min' might be used uninitialized in this function 
- skill.c:6648: warning: 'matk_max' might be used uninitialized in this function 
- skill.c:2826: warning: 'sid' might be used uninitialized in this function

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6816 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 10:27:02 +00:00
Lance
bdac5d6c09 [Optimized ]
Removed unused variable (account_id) in storage_guild_storagesaved.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6815 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 10:12:26 +00:00
Lance
a28e9d802c [Optimized]
- Removed unused checks for unsigned data type and possible logic error for char type (gcc treats char as unsigned).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6814 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 09:53:45 +00:00
Lance
a796714516 [Fix]: Ressurect instead of making you die again when logging in.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6811 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 02:15:16 +00:00
Lance
f1edfd7ba4 - Relogging in with 0 HP didn't trigger dead event.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6810 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29 01:58:43 +00:00
skotlex
f2cedb537e - Added functions status_revive, pc_revive and mob_revive to handle revival (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://svn.code.sf.net/p/rathena/svn/trunk@6807 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 17:58:56 +00:00
Lance
f77f199488 - Reverted buildin_setd to use NULL as reference.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6802 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 14:11:01 +00:00
Lance
d9de89b463 [Fixed] script functions that doesn't pass references, thanks to End_of_exam.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6801 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 14:05:03 +00:00
Lance
025d6e6a01 * [ Protected ] : clif_parse_LGMmessage from possible hacks
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6797 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 11:29:43 +00:00
skotlex
2466911af0 - Fixed unable to store n items into storage unless n was the total amount of items you had.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6794 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 05:29:01 +00:00
Lance
bb1b0409a1 - Suppressed compilation warnings (unsigned and signed mismatches)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6793 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28 03:24:03 +00:00
skotlex
df08df8e5d - Addded missing include of limits.h to battle.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6792 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-27 19:10:21 +00:00
skotlex
856240443d - Added structure status_data which holds status-related information (str, 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://svn.code.sf.net/p/rathena/svn/trunk@6791 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-27 18:08:30 +00:00