summaryrefslogtreecommitdiff
path: root/src/map/pc.c
AgeCommit message (Collapse)AuthorFilesLines
2006-06-17- Devotion absorbed damage will now appear to come from oneself (instead of ↵skotlex1-1/+1
the original attacker changing directions towards the Crusader) - Updated clif_refres to send inventory, cart, and weight info. - Fixed intif_guild_memberinfoshort to not leave a dangling pointer when someone logs out <.< - Cleaned up a bit guild_check_member git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7226 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16- Fixed option value being reset'ed on login (fixes cart/peco/falcon being lost)skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7217 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- Modified the bNoMagicDamage/bNoWeaponDamage bonuses to be a 0-100 setting. ↵skotlex1-4/+8
Meaning you can do bonus bNoMagicDamage,50; To make all magic damage be reduced by half. This bonus stack, so two cards with bNoMagicDamage,50 will give magic immunity. - Removed setting gtb_pvp_only and replaced it with gtb_sc_immunity which specifies the threshold before the bNoMagicDamage starts blocking support statuses as well. ie: gtb_sc_imunity: 75 will mean that "bonus bNoMagicDamage,70;" reduces magic damage by 70%, but does not blocks heal or support status, while "bonus bNoMagicDamage,80;" does. - Updated GTB's card script to be "bonus bNoMagicDamage,100;" git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7212 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16* [Improved]: Lance1-7/+2
- 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-15- Fixed "wedding_ignore_palette: yes" not working when relogging with the ↵skotlex1-5/+5
gear already equipped. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7189 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-15- Altered a bit how status_set_viewdata behaves in regards to Wedding/Xmas ↵skotlex1-8/+14
options. - Added back OPTION_XMAS, but the actual value is missing! - Corrected chrif_save so that the player is not set offline on map-change. - Added change-look support in pc_setoption when specifying OPTION_XMAS - Fixed clif_parse_RemoveOption removing all options instead of just Falcon/Cart/Peco git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7183 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-15- Fixed and cleaned up script command 'equip'skotlex1-3/+3
- Fixed 'autoequip' items. - Fixed Aspd not being updated in your status window after Agi/Dex increasing statuses take effect. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7179 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13- Added HM_SKILLBASE, MAX_HOMUNSKILL to specify the skill level range of ↵skotlex1-10/+10
Homunculus. - Added support for reading correctly status change data from Guild and Homun skills. - Added support for reading Homun skill data (which means the HM skills are now safe to add to skill_db, skill_require_db, etc) - Moved StatusSkillChangeTable to StatusSkillChangeTableArray and made a function called StatusSkillChangeTable to do the conversions taking into account HM/GD skills. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7128 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-12- Fixed npc_checknear's distance check returning the opposite of what it ↵skotlex1-5/+2
should (false when the range is correct and viceversa) - SL_STIN/SL_STUN have dex-reducable casting times now. - Added a warning on item loading when an item is of equippable type but has no equippable position. - Turning an alliance to an opposition won't work now during WoE - Slaves can summon other mobs now. The only ones who can't do this are player summoned mobs. - Merged the following functions for faster processing of items: clif_storageitemlist + clif_storageequiplist = clif_storagelist clif_guildstorageitemlist + clif_guildstorageequiplist = clif_guildstoragelist clif_itemlist + clif_equiplist = clif_inventorylist - Increased max knockback value support to 25. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7109 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-10- Added structure party_data and party_member_data to the map server to hold ↵skotlex1-9/+5
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-08- Cleaned clif_pvpset to not send the packet to nearby characters when the ↵skotlex1-4/+2
source is GM-hidden. May help fix the crash on PvP with gm-hidden characters. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7053 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-08- Fixed Sense using mdef instead of mdef2skotlex1-1/+0
- Fixed item-skills not showing up on login. - Cleaned up clif_parseLoadEndAck, by testing which packets are required only on first-login and which ones are required on all map-changes. Skill-tree, Exp, Skill Points and most of the basic status are no longer sent on map-change (items, carts, zeny still need to be sent one very map-change). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7042 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07- Added pc_calcexp to calculate individual exp bonuses acquired from exp's ↵skotlex1-4/+54
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-05- Fixed a pair of signed/unsigned mismatch comparison warnings in pc_bonus. ↵skotlex1-2/+2
Thanks to Nuisance for complaining. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6987 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-05- Cleaned up code for SC_MINDBREAKER.skotlex1-8/+8
- Changed hit, flee, cri, flee2, def2 and mdef2 to signed short, def, mdef to signed char to correctly account for cards with penalties in said stats. - Added cap_value checks in all of the status_calc_* return paths to make sure no stat is invalid. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6986 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-05- Corrected cloaking not ending on attack if you are near a wall.skotlex1-42/+65
- Moved define cap_value to map.h as it's quite handy. - Updated pc_bonus to use cap_value on all status_data modifiers to prevent overflows/underflows. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6979 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-02- Corrected clif_parse_takeitem to ALWAYS return a NAK packet when it failsskotlex1-13/+12
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6943 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-02- Altered status_calc_pc so that equipment scripts are ran before card-scripts.skotlex1-4/+16
- Fixed pc_bonus to not underflow/overflow when adjusting def/mdef. - These two together, should fix Tao Gunka Card. - npc_debug_warps() will now be invoked if warp_point_debug is set. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6925 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-02- Updated item_db.sql/mob_db.sql to current.skotlex1-2/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6922 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-01- Fixed pc_damage setting your canlog_tick even if the damage has no source ↵skotlex1-3/+6
(eg: poison, berserk) - Berserk's aspd bonus now stacks with other aspd bonuses, and is unaffected by Quagmire/Forget-me-not. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6916 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-01- Corrected setting slaves_inherit_mode to not apply to morphosis skills.skotlex1-2/+12
- 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-05-31- Some cleaning of the fame-update code, fixing a logic bug which made the ↵skotlex1-1/+1
ranking list fail to display the correct ranker names. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6891 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31[Improved]: Lance1-6/+6
- Fake NPC interface to use real NPCs. - Scripting interface to restore and save sd->npc_id. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31- Added function pc_check_skilltree for checking if you unlocked new ↵skotlex1-11/+61
tree-skills when raising non-passive skills. - Some cleaning of pc_calc_skilltree - Fixed flee/hit calculation in status_calc_bl to account for bonuses from the base status. - Some cleaning of status_calc_pet to use the cap_value define. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6872 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30- Fixed status_damage not setting your HP to 0 when you died T.Tskotlex1-8/+8
- Fixed the pcbonus2 warnings using the wrong value before printing the invalid Element error. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6864 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30- Added a pair of missing pc_setstand in the pc_dead function.skotlex1-0/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6861 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30- Fixed Absorb Spirit Spheresskotlex1-1/+2
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6859 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30- Updated attr_fix_table reading code to account for ELE_MAX (will correctly ↵skotlex1-7/+57
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-29/+17
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-30(I need sleep)Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6845 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30Final alteration :PLance1-4/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30[Corrected]:Lance1-5/+7
- pc.c again (Darn I'm making more mistakes) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30[Fixed]:Lance1-1/+1
pc.c to use unit_stop_attack() git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30* [Fixed] Lance1-0/+4
- Pets attacking even master is dead git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6841 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29- Fixed pc_gainexp resetting your exp to 0 rather than adding it in... -.-skotlex1-6/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6828 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29[Fixed]: Lance1-9/+12
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6822 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29- Fixed pc_readparam/pc_setparam to use battle_status.hp/sp rather than ↵skotlex1-8/+8
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6817 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29[Optimized] Lance1-6/+2
- Removed unused checks for unsigned data type and possible logic error for char type (gcc treats char as unsigned). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6814 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29[Fix]: Ressurect instead of making you die again when logging in.Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6811 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29- Relogging in with 0 HP didn't trigger dead event.Lance1-0/+5
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6810 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28- Added functions status_revive, pc_revive and mob_revive to handle revival ↵skotlex1-1/+9
(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-3/+4
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-664/+449
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-26* Patches to allow everything to work right. + 1 more sample script.Lance1-29/+40
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-26I'm still here!DracoRPG1-32/+31
Rewrote fame ranking lists git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6764 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23- Fixed wedding sprite staying active after unequip.Zido1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6719 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23- Corrected clif parse name request failing on disguised characters.skotlex1-29/+30
- 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* WARNING: New scripting system contains memory leakLance1-1/+1
TODO: Free all scripts using script_free_code() instead of old methods. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22SC_SPEARSQUICKEN -> SC_SPEARQUICKEN normalized enum nameLupus1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6684 54d463be-8e91-2dee-dedb-b68131a5f0ec