summaryrefslogtreecommitdiff
path: root/src/map/pc.c
AgeCommit message (Collapse)AuthorFilesLines
2008-02-23Fixed a mistake in r12232 related to char savingultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12235 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-22* Removed code in socket.c that tries to avoid send buffer overloading, as ↵ultramage1-36/+37
there is a scenario (many players and charserver disconnect) where mass char saving produces huge ammounts of data to send (see r11503) * Cleaned up player respawning code (bugreport:1022) * Increased the max amount of different autocast skills from 5 to 10 * Added a missing function declaration, for real this time (followup to r12229) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12232 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-21- Added status_calc_life to properly calculate hp/max_hp as a ratio taking ↵skotlex1-1/+2
into accounts overflows (and for now also avoids divisions by 0). Applied this function around clif.c, mob.c and pet.c - Implemented the correct walk-speed bonus from the Bard/Dancer spirit. - Added a few error messages in case something goes wrong in the new auth db system. - Fixed logarithmic drops turning 0% drop rates into 100%. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12225 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-21- Fixed new guilds displaying online-connect member count at 0 rather than ↵skotlex1-122/+49
1, and the guild master not knowing it is one (eg: it cannot edit the guild notice of a newly created guild until relogging). - Fixed acc_reg2 parsing screwing up the char_id and subtracting 2 from it rather than passing it as it is. - Extended the auth_node/auth_db system in chrif.c to handle log in/out and mapserver-change procedures. This way players are not in the main dbs when they are not "active", which blocks potential invalid accesses to them. - Replaced states auth, waiting_disconnect and finalsave with active. - Cleaned some the party/guild login and creation procedures, removed the party_sent/guild_sent states. - Removed a redundant guild_check_member call which is beyond not-needed and into the realm of wasting resources. - clif_parse will no longer process packets from !sd->state.active players, this also makes checking for finalsave uneccessary (since players re already removed from the maps and dbs by this point, so you can't access them in any other way) - Separated the roles of unit_free and map_quit, the former will handle cleaning structures from the player so it can be free'd safely, while the latter performs additional routines which are unique to characters logging out normally (map-server changes will invoke unit_free and bypass map_quit). - Removed pc_isplaying, quit_db, map_knowsaccount, MAPIT_PCISPLAYING among other functions/defines which are no longer needed due to the new login scheme. - Cleand up a bit some code in the clif_send(_sub) functions. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12223 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-20Changed pc_can_give_items() to use standard boolean logic instead of the ↵ultramage1-8/+4
inverted 1/0 one (bugreport:396) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12220 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-18- added LK's concentration +1 MDEF.skotlex1-3/+5
- Corrected delay-consume items being consumed when used while casting or being unable to act. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12216 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-17- Updated Eye of Hellion to use the new format of the input command.skotlex1-0/+7
- corrected login_fd/char_fd being uninitialized in the char servers. - Changed a bit around how status_base_atk works to avoid overflows. - Added a check to prevent using consume-delay items when you cannot use skills, since that opens an exploit if the item also has non-skill-casting components to its script. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12214 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-15- Fixed S. Novice bonus not dispelling when at the moment you die once.skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12207 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-15some compilation warning fixesultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12206 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-10Added two missing opt2 values, for Angelus and Bleeding status.ultramage1-129/+61
Cleaned up pc_statusup and pc_statusup2. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12190 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-07- Fixed Freezing Trap doing no damage (changed type from misc to weapon)skotlex1-0/+2
- Changed suiton's element to water (apparently fixes not being able to use water-based skills on it) - Fixed Landmine doing no damage (decreased trigger range to 0 to match its splash range) - Fixed the disguise commands using the wrong variable when attempting to disguise as an npc. - Fixed a compilation warning on CELL_CHKNODAMAGE (which is a totally bad-ripoff of basilica cells anyway) - Corrected and optimized npc_remove_map's npc array cleanup (@reloadscripts no longer report 'too many npcs per map and related dangling pointer crashes are fixed) - Removed suspicious, yet totally unused npc_data variable 'n' - HP loss item scripts can no longer kill you. - Corrected the item-drop-rate check to avoid duplicate entries in @whodrops after a @reloadmobdb - Cleaned up and optimized map_addnpc (there are never any gaps in the npc array so npc_num always points to the last valid entry) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12180 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-29- Modified pc_dead so that the src is passed on to the master when it is a ↵skotlex1-15/+21
pet or homunculus. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12150 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-23- Fixed pc_setrestartvalue not correctly setting your SP when sending to ↵skotlex1-3/+2
save to the char-server while dead. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12136 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14Applied a temp patch to make some npc-executed atcommands work again ↵ultramage1-1/+1
(bugreport:790). Added support for right-click-gm-menu kicking NPC objects. Removed redundant function npc_checknear2(). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12073 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-10- Fixed getmonsterinfo to return "null" when returning the name of a ↵skotlex1-4/+4
non-existing mob instead of -1. - Extended the status_percent_damage define to include a bolean to specify whether or not the target can be killed from it. - Corrected CR_CULTIVATION to fail when the target cell has some BL_CHAR on it already. - Changed the meaning of 'flag' in status_percent_change, to enable differentiation between damage that can kill the object and damage that cannot. - Script command percentheal will no longer kill the player if the specified amount is negative (and not -100). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12051 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-10- Removed 'skill_steal_type' from skill.conf as said config no longer exists.skotlex1-3/+2
- Corrected @slaveclone/@clone behaving as @evilclone when you change the @ symbol. - Modified SC_ARMOR_ELEMENT so it grants elemental resist as if it they were card granted bonuses. - fixed a SA_DISPELL crash when casted on an object with no status changes. - Adjusted the autospell code so that it does not relies on card_id == 0 for subtracting rates. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12041 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-09- corrected duration of sphere mines to be 30 secs regardless of skill levelskotlex1-0/+5
- Corrected duel_count/duel_list (you DON'T place variables in a .h file! That is what 'extern' is for) - Script command warpportal now places a warp in its initial state (as if a real warp portal was casted) - Updated dispell to also not remove the following effects: Hindsight, Inc Hit/Atk Rate (NPC_POWERUP), Nen, TK stances and tumble, warm and speedup1 (the other speed potion) - Chase-walking characters can now loot. - Hiding characters can't drop items now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12036 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-08- Made the pc reg variables receive a const char* as the argument, since ↵skotlex1-2/+2
they duplicate the value anyway (and they were receiving const char* values from the setd function) - Fixed Wand of Hermod not starting the SC_HERMOD status change (which blocks spells) - Fixed a missing break in the cast cancel code. - Fixed additional def/mdef from vit/int bonuses being lost when a status change that affects def/mdef triggers (for homunculus) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12033 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-29Implemented THE official Steal skill equation and game mechanics (basically ↵ultramage1-13/+13
version from /stable plus a few tweaks) (see topic:116540). Added missing bAddStealRate reference to doc/item_bonus.txt. Removed skill_steal_rate, as it was never used in the code (see r231). Removed skill_steal_type, it's just a one-liner source mod (see r231). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-27Removed an incorrect range check and fixed a copypaste typo which caused ↵ultramage1-6/+1
script engine errors / crashes (see r11984) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11987 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-27* Corrected description of scope and npc variables in script_commands.txt.FlavioJS1-20/+34
* Made temporary character string variables not have a limited length. (now all temporary string variables don't have limited length) * Made temporary character variables reuse free positions. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11984 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-26Moved distance-related functions to path.c/hultramage1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11981 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-24some minor cleaning of player variable loading/savingultramage1-84/+75
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11975 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-23- Fixed horrible handling of skill_abra_db which leads to memory corruption ↵skotlex1-1/+1
(depending on the contents of yor abra_db.txt file) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11970 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-23- Fixed warning about unused variableskotlex1-1/+1
- Made the kaahi heal timer function uncrashable. - Fixed pc move item to cart function checking against the wrong max index. - Fixed initialization of sd issue in map_addblock - Removed redundant reinitialization when parsing item pickup. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-18- removed redundant clif_hominfo line in merc_hom_dead (it was sent already ↵skotlex1-3/+3
from hom_damage) - Item usage is now blocked while hidden. - Moved the bladestop/berserk check from clif_parse_EquipItem to pc_equipitem git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11942 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06- The default event script behaviour is to trigger on labels rather than ↵skotlex1-49/+7
NPCs now. - Removed several script config options which break NPC compatibility when you mess with them (event_script_type, event_requires_trigger, die_event_name, kill_pc_event_name, kill_mob_event_name, logout_event_name, login_event_name, loadmap_event_name, baselvup_event_name, joblvup_event_name) - LoadMap events no longer set the variable "@maploaded$" to the name of the new map. - Optimized/simplified the code now that the previous config options were removed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11859 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-05- Made the struct weapon_atk lhw in status_data a static member rather than ↵skotlex1-6/+6
a pointer as requested by Ultra Mage. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11858 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-30- pc_setoption no longer does view_data changes while disguised (as this ↵skotlex1-0/+3
breaks things) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11845 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-30* Random cleanup/documentation.FlavioJS1-6/+6
* Made common/Makefile get the svn version from the src directory, not src/common. * Added a warning message to the install and uninstall targets. * Renamed all obj directories to obj_all, obj_txt or obj_sql in the makefiles (if an obj/ directory exists, BSD make enters it before reading the makefile) (run ./configure to update your makefiles, and don't forget to do 'make clean' before updating) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-29- Allowed disguising while riding a peco-peco (this does not seem to cause ↵skotlex1-10/+14
problems anymore) - Adjusted pc_disguise to work properly if invoked while a player is not in a map. - The pvp rank packet is no longer sent to other players when disguised, as this leads to crashes when you die. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-29- Integrated the SG related info of hate_mob and feel_map into a single ↵skotlex1-22/+11
structure (sg_info). - Modified skill_blown and skill_attack so that reflected spells do not cause knockback. - SG Blessing skills now grant the extra experience to everyone when the SG killed the mob. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11840 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-28- Reverted the position of the max_hp/max_sp basic setting, modified the ↵skotlex1-12/+10
max_hp/max_sp bonuses to use casting in order to work correctly with negative bonuses. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11832 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-25Giant Fly Wings are now blocked on noteleport maps and duels.L0ne_W0lf1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11804 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22- Changed the status_change structure to use dynamic rather than static ↵skotlex1-47/+50
memory to hold the individual status changes, this should have a noticeable impact on the server's memory consumption. - Had to add a few 'ugly' flags to status_change since now you can't track SC related information while said SC is not active (happens only for Storm Gust, Joint Beat and Magic Power). - Since I am unable to fully test, watch out for any bugs~ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11786 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-20- Implemented SL_SUPERNOVICE erasing the death record 1% of the casts.skotlex1-18/+35
- Implemented current exp being capped to the exp required to level up from the previous level when we are at max level (required for some S. Novice buffs) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11764 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-17Removed battle_config.error_log as console_silent already handles thisultramage1-84/+43
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-15- Added 2 new status changes for Life and Regeneration Potions [Zephyrus]zephyrus1-0/+4
- Fixed some items boxes giving wrong tamings. - Fixed another item giving 48 gladius[3] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11738 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-14Fixed some homunculus skill offset calculation mistakes (bugreport:363)ultramage1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11731 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-12Added error reporting to buildin_warp when it fails.ultramage1-4/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11727 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-11- Added missing include npc.h to map.cskotlex1-2/+18
- Now when job changing to another class tree, status changes from skills that belong to your previous class are cleared. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11716 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-11- Cleaned up pc_calc_weapontypeskotlex1-19/+33
- made on-touch areas work with walking npcs. Note that the implementation is performance may not be optimal, but I am not sure if it can be done in any better way. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11713 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-09Replaced several 'int' variables with enums that they represent.ultramage1-16/+18
Expanded weapon_type enum with dual-wield constants (bugreport:384). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11704 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-08- Added a new setting 'guild_skill_relog_delay' to activate the guild skills ↵zephyrus1-2/+2
delay on Guild Master relog. - The official setting is 'No', but this is an option for game masters. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11699 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-31* Added names to the SC_ and SI_ enums, now they can be used to properly ↵ultramage1-29/+27
indicate where such values are to be used (replaces usage of 'int') * removed MIN_/MAX_PORTAL_MEMO, set MAX_MEMOPOINTS from 10 to 3 * removed support for @go-ing to your memo points * simplified the overly verbose @memo command; now re-uses pc_memo() * cleaned up pc_memo(), now uses semi-correct packet replies * Minor code cleaning/formatting git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11625 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-31- Fixed the pc_additem weight check breaking when your current weight is ↵skotlex1-1/+1
above your max. - Some minor cleanups. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11621 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-29Command code cleaning (refer to topic:169759)ultramage1-1/+1
* separated the execution part of command code into interface part and internal part to better see which checks are done and when (fixes problem where 'nocommand' mapflag blocked server npcs) * moved the internal commands list (array) to the end of the file, this let me discard that long block of ACMD_FUNC() declarations * removed enum AtCommandType from command headers and commands array; its purpose was perhaps to identify aliased commands, but apparently it was never finished because the rest of the code doesn't use it (also doing aliases like this is not a very good idea) * internally, commands are now referenced to using their function name * removed the @/# symbols from the command lists; all lookup functions will now properly deal with strings with- and without a command symbol (commands interface still requires the symbol tho', so TODO for later) * removed several unneeded commands (*id2 code, dmalloc debug commands) * reverted atcommand config from alphabetically-sorted to how it was before (with additional fixes; see /conf changelog) * added missing code for #dropall / #storeall * added a warning when trying to set gm level of an undefined command The structure of the commands table has changed, please adjust docs/guides to match the new format (sorry for the inconvenience). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11607 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-26Moved the new novending cell check from the internal code to the ↵ultramage1-2/+2
client-server interface (allows server to force-open shop if needed) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11580 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-24- added defines JOB_MAX_BASIC and JOB_MAX to mmo.h so the code can know ↵skotlex1-34/+52
which are the max valid classes. - @/#jobchange no longer strip your equipment since pc_jobchange removes any unequippables already. - removed the wasteful define MAX_PC_CLASS and replaced it by the CLASS_COUNT define (which is automatically updated using the previous JOB_MAX* defines) + pc_class2idx function (which converts high class IDs into values that fit in CLASS_COUNT) - Made status_charge a function rather than a define to get rid of those warnings that have been there since forever. - Merged the CELL_NOVENDING code (see topic #129209) - Small check that disables the pet catching process if you try to use another item. - Added a check to fix a warning and prevent a crash in the npc duplicate check (even though I have no idea what this check is supposed to do, therefore I can't fix it properly other than to avoid the crash) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11572 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-22- Added the new mail system. Requires optimization and tests.zephyrus1-6/+4
- Updated the maildb sql structure. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11548 54d463be-8e91-2dee-dedb-b68131a5f0ec