summaryrefslogtreecommitdiff
path: root/src/map/clif.c
AgeCommit message (Collapse)AuthorFilesLines
2006-06-19- Removed the mysterious array of two of char_dat (char/sql server), ↵skotlex1-4/+3
replaced it with a static structure. - Added function char_loadName to extract the character name of a given ID. - Fixed fame-list updating crashing char-sql server when the given char-id just got into ranking. - Sorry I didn't check if it compiles cleanly because I don't have sql here <.< (am gonna test it in a second, though) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7248 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-19Idiot RO client have inconsistent signed/unsigned shortsLance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7243 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-18* [Fixed]: Lance1-1/+1
- clif_initialstatus using SHRT_MAX instead of USHRT_MAX for status_point git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7237 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-18* [Removed]: Lance1-5/+7
- 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- Devotion absorbed damage will now appear to come from oneself (instead of ↵skotlex1-1/+8
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-17* [Added]: Lance1-1/+1
- 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-17- Fixed the party HP packets to send max HP 10000 and scale HP accordingly ↵skotlex1-6/+21
when the player's HP doesn't fits in the packet's field. Fixes HP bars not correctly displaying the % of life when max HP is above 32k. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7218 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-16- Merged Adam's patch to let the char-server handle validation of ↵skotlex1-1/+1
pet-name-change requests through the allowed char letters config. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7192 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-15- Altered a bit how status_set_viewdata behaves in regards to Wedding/Xmas ↵skotlex1-3/+4
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 clif_send not sending packets to SELF when specifying AREA if the ↵skotlex1-3/+5
source is not on the map yet. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7180 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13- Fixed a packet_ver error with the #defines in clif_spawn.skotlex1-5/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7145 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13- Fixed compilation error on clif.cskotlex1-3/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7135 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7130 ↵Lance1-1/+1
54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13* [Fixed]: Lance1-4/+5
- clif_parse_GetCharNameRequest displaying false alarm for legitimate GM snooping. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7129 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-13- Added HM_SKILLBASE, MAX_HOMUNSKILL to specify the skill level range of ↵skotlex1-3/+3
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-13- Updated clif_disp_onlyself to not use dynamic memory and write directly to ↵skotlex1-31/+34
the player's buffer. - Updated @noask to also tell the rejected what he has just rejected (added msg_athena entries for each of the different requests) - Since noask already does a player lookup, updated the corresponding parsing functions to take the player rather than the player id (prevents double lookups) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7117 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-12- Fixed a pair of missing initializers in the clif storage functions.skotlex1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7113 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-12- Fixed npc_checknear's distance check returning the opposite of what it ↵skotlex1-388/+198
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-12- Made guild member exp an unsigned int.skotlex1-16/+33
- Modified npc_click to receive the bl that was clicked directly. Also cleaned it up so it isn't as easy to crash the server with invalid ids <.< - Moved npc_checknear to npc_checknear2 and added npc_checknear. The near version receives a bl, checks it's validity, and returns a TBL_NPC object, near2 does the same but doesn't checks for type NPC. The first returns a pointer, the second returns 1 on fail, 0 success. - Also uncommented various npc_checknear calls in the code, who's idea was to comment them out so you could exploit npcs from afar with custom packets? - Added overflow checks for bonus settings mdef_rate/def_rate. - Added missing update of INT after a buf. - Small cleanup of how SC_BLEEDING works. - Fixed party_foreach_samemap invoking the function on the CASTER instead of on the party members. - Added clif_parse_ActionRequest_sub to handle player commands, is used from npc_click or any other function that needs to "re-route" a player's request. - Modified clif_parse_NpcClicked to handle the different situations with different bl-objects (attack on players/mobs, click on npcs or mobs with npc attached) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7103 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-10- Added structure party_data and party_member_data to the map server to hold ↵skotlex1-71/+68
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-9/+5
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-16/+25
- 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-05- Cleaned up code for SC_MINDBREAKER.skotlex1-0/+1
- 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-02- Corrected clif_parse_takeitem to ALWAYS return a NAK packet when it failsskotlex1-20/+26
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6943 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- 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 being unable to unequip stuff while the storage is open.skotlex1-3/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6920 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-01- SC_ORCISH will now be dispelled on logout (if debufF_on_logout is set)skotlex1-2/+9
- Removed attackrange/attackrange_ from TBL_PC, corrected clif.c using the incorrect range variable. - You can now equip/unequip stuff while the storage is open. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6908 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31* [Fixed]: Lance1-2/+4
- nullpo in pet.c caused by equipping without checking if the pet is available. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6882 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31[Improved]: Lance1-4/+4
- 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-30- Fixed Absorb Spirit Spheresskotlex1-0/+28
- 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[Optimized]: Lance1-55/+14
- clif_specialeffect to use the enums. [Improved]: - buildin_specialeffect and buildin_specialeffect2 to accept effect area definition. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6855 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-30- Small optimization in battle_check_targetskotlex1-16/+16
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6847 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-29- Relogging in with 0 HP didn't trigger dead event.Lance1-1/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6810 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-28* [ Protected ] : clif_parse_LGMmessage from possible hacksLance1-3/+9
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6797 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-27- Added structure status_data which holds status-related information (str, ↵skotlex1-94/+75
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* Mob control engine tested 99% working so far.Lance1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6770 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-25- Increased capacity for Account Variables to 64skotlex1-2/+4
- Reverted Intravision implementation to that of stable's. - Corrected Login Server taking it's first argument as both login config and lan config. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23- the charname request hack message has been downgraded to only include ↵skotlex1-27/+27
GM-invisible characters. - corrected clif_charnameack to send negative ID when a disguised player asks for it's own disguised name. - Cleaned up the disguised target-id checks taking into considering that the only character that sees a negative ID is the same disguised character. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6715 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23- Corrected clif parse name request failing on disguised characters.skotlex1-4/+4
- 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-23* Added 'setd' support for local NPC scope (') variables.Lance1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6704 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-23* [Scripting Engine Update] New variables are ready to be used. Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6703 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-22* Fixed compilation errors.Lance1-3/+4
* Tidy up jobmaster for easy debugging. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6686 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-21* Part A of the Homunculus code.blackhole891-0/+160
This only features the structures, status_* and clif_* (packets) and is not functional yet in any conventional way, but doesn't interfere with present functionality either. I would only forget half of this stuff if I tried to do all at once. Expect the rest somewhen within the upcoming week. (This is not similar to jA's implementation.) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6681 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-21And againLance1-1/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6672 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-21* Fix the fix: Should be sd->npc_str[message_len]=0;Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6671 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-21* Exploit prevention in clif_parse_NpcStringInputLance1-5/+9
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6670 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-18- Rewrote/cleaned up several functions in storage.cskotlex1-11/+3
- Optimized pc_additem comparisons to account for items with more than four slots. - Updated clif.c to enable retrieval of items from cart/storage while trading. Exception is retrieving items from the cart while vending. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6642 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-18- Applied an experimental weather code that should lower bandwidth usage to ↵skotlex1-39/+20
near-none, which's only disadvantage should be the weather not clearing out until moving to another map (even when the mapflag is removed from the current map). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-17Removed AtCommand_Monster and replaced it with AtCommand_Spawn for Skots ↵reddozen1-1/+1
[Reddozen] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6626 54d463be-8e91-2dee-dedb-b68131a5f0ec