summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2008-02-27Fixed 'cleararray' not able to erase array entry 127 (bugreport:864)ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12253 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-19* Forgotten update to the definition of script command 'input'.FlavioJS1-1/+1
* Enabled DEBUG_MEMMGR only in DEBUG mode. * Made autotrading characters be kicked instead of reporting double login. * Made create_session initialize session_data to NULL. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12218 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-15some compilation warning fixesultramage1-12/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12206 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-11Getting rid of map_getallusers(), part 1ultramage1-123/+96
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12195 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-11* Expanded the script command 'input': (bugreport:811)FlavioJS1-14/+39
- two new optional arguments 'min' and 'max' - return value indicating if it's in the correct range - config variables for the default value of the arguments: 'input_min_value' and 'input_max_value' in script_athena.conf git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12192 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-08Fixed wrong message in item group loading code (bugreport:936)ultramage1-1/+1
Fixed 'charisalpha' not working for the first char (bugreport:940) Disabled signed/unsigned warnings for visual studio 2005 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12186 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-04- Some code cleanups.zephyrus1-0/+62
- Added new Cell types (NoChat and NoDamage) - Added JobChangeLevel and FreeSKPoints to #stats - Added a Crash protection in clif_send with invalid fd values. - Merged a missing update in TK Mission. - Added script command 'getmapflag' - Merged some new Status Change to Stable. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12175 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-02Fixed npc reloading crash (bugreport:889)ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12166 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-30- Fixed a serious zeny exploid on scripts. Please update!!zephyrus1-0/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12153 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14Fixed card removal script functions' 'extra card' bug (bugreport:786)ultramage1-61/+60
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12075 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14Removed the hardcoded limit for numeric npc input boxes (bugreport:811)ultramage1-6/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12074 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-10- Fixed getmonsterinfo to return "null" when returning the name of a ↵skotlex1-1/+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-09- corrected duration of sphere mines to be 30 secs regardless of skill levelskotlex1-1/+1
- 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
2008-01-06Cleaned up mob_once_spawn() and mob_once_spawn_area().ultramage1-27/+48
- now they use mapid instead of mapname as input parameter - moved the responsibility to perform "this" -> mapid resolution to the caller - added a pair of swap() operations to prevent working with a negative-dimensioned area (fixes bugreport:87) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12022 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06Modified showmsg code to not attach a timestamp to MSG_NONE-type messages, ↵ultramage1-51/+51
generated by ShowMessage(). It now works exactly like printf(). Removed/replaced all printf calls in the code. Added a new flag to setting 'console_silent', for filtering debug messages. Silenced the "Broken pipe found" and "Server running in debug mode" messages. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12020 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-04Modified the map_setcell() code to to use a boolean flag instead of needing ↵ultramage1-0/+28
SET_ / CLR_ pairs of defines (topic:174323). Also removed script object 'setcell', added script function 'setcell'. - Now you can manipulate cell information without needing @loadnpc - You can also manipulate the terrain ('gat') type itself, using the new cell_walkable, cell_shootable and cell_water constants (currently the implementation uses bit flags too, so to get the type you want, you need to adjust the flags one by one) - This breaks current scripts, so please adjust places that use setcell (also be sure to _only_ use predefined constants, not direct numbers) - Details can be found in the script reference. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12009 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-03Removed map_data's block_count, as (quote Yor/ja2160), "Perhaps useful for ↵ultramage1-10/+6
debug, but uses memory AND CPU for nothing." (block lists are linked lists, they don't need count tracking) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12001 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-30* Fixed get_val2 not using the stack, which automatically frees the data, ↵FlavioJS1-8/+17
causing memory leaks for string variables since r11976. (bugreport:723 , part of bugreport:714 and part of bugreport:708) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11997 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-27* Corrected description of scope and npc variables in script_commands.txt.FlavioJS1-5/+2
* 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-1/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11981 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-26* Fixed string variables dereferencing directly to the value instead of ↵FlavioJS1-8/+17
dereferencing to a copy of the value. (fixes bugreport:684 bugreport:641) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11976 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-14Guardian hp handling code removal (see bugreport:342)ultramage1-45/+32
- removed guardian hp from the castle data structure, database, savefiles and various script functions (use upgrade_svn11914.sql) - removed guardian hp calculation and manipulation from the castle manager npc, now the hp values are updated by the server itself (glitch: when castle defense changes, all guardians are healed to full) - tweaked script function 'guardianinfo' to provide some data needed by the manager npc (currently available are hp, maxhp and visibility); also, it doesn't need a player attached to execute anymore The whole thing is experimental, use at your own risk (seems to work though...) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11915 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-13* Fixed possible segmentation faults in the script engine.FlavioJS1-19/+23
- some strings that can be freed outside the script engine were being pushed into the stack as constant strings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-11- Added query_logsql script command to perform sql commands using the log db ↵skotlex1-12/+31
connection. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11892 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06ooops, two errors escaped... >.<FlavioJS1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11861 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06* Removed the attempts to recover from invalid syntax in npc_parsesrcfile ↵FlavioJS1-73/+233
since they can produce incorrect results (spaces in sscanf can match \n's and company). * Made script_rid2sd report the script source directly and changed related return 1's to return 0's to avoid double script source reports. * Added missing return 0's after script_rid2sd is used and an extra error message in buildin_set/buildin_setd. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11860 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06- The default event script behaviour is to trigger on labels rather than ↵skotlex1-64/+13
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-11-27* TXT/SQL login server code synchronizationultramage1-1/+1
- exported several core structures to login.h - split off ladmin communication code from the TXT login server - removed all occurences of login_log(); a unified function should be added when SQL's loginlog_db logging code gets synced with TXT - removed conf setting login_log_filename - fixed ladmin getting timeouts since the ping system was changed - removed login/char server_fd[] arrays, added server[].fd instead git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11826 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27- Cleaned some more the sc_end check so it is more generic and not so ↵skotlex1-13/+11
limited just to infinite endure. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11821 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27- Corrected the online_data_cleanup routine setting offline characters that ↵skotlex1-0/+6
are still connected to the char-server. - Added a check in script command sc_end to properly end infinte endure - ASC_BREAKER no longer triggers status effect cards. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11817 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-26* Fixed buildin_query_sql using Sql_Query instead of Sql_QueryStr, wrongly ↵FlavioJS1-1/+1
processing all %f,%d,... (fixes bureport:218) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11809 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-23Fixed some old mistakes in npc shop code causing misinterpretation of the ↵ultramage1-4/+5
number of function parameters (bugreport:404) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11788 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22* Moved the reset of references to after the empty script checks in ↵FlavioJS1-12/+15
parse_script. (fixes bugreport:222 and bugreport:449) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22* Renamed fakenpcname to setnpcdisplay, fixed and extended it. FlavioJS1-12/+48
- See doc/script_commands.txt for information on how to use it git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-21- Moved subtype from struct block_list to struct npc_data.skotlex1-6/+6
- Fixed some compilation warnings. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11772 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-18* Replaced jA's way of allocating npc shop data with a simple dynamic array ↵ultramage1-88/+50
that gets allocated during loading and freed on unload - automatically fixes bugreport:404, which would otherwise require manipulating the npcname_db (the original author didn't, hence the bug) - now a supporting variable 'count' is used for tracking the length instead of an extra dummy entry at the end of the shop list - partially removed the MAX_SHOPITEM restriction (if this was written properly, the system could support an unlimited amount of entries) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11753 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-18Fixed npc_debug_warps() not identifying x:0,y:0 as valid (random) coordinatesultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11752 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-17Removed battle_config.error_log as console_silent already handles thisultramage1-24/+14
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-12Added error reporting to buildin_warp when it fails.ultramage1-12/+18
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11727 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-11Applied Rayce's improvements to the npc script parser (see bugreport:387 for ↵ultramage1-11/+15
details). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11715 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-10Fixed some more gcc incompatibilities...ultramage1-40/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-09Replaced several 'int' variables with enums that they represent.ultramage1-6/+6
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* Changed EXIT_SUCCESS back to 0 in console.c to avoid an unnecessary include.FlavioJS1-10/+10
* Fixed gm_account_db not being deallocated in login-converter.c. * Refactoring names and documentation in db.h/db.c: - changed 'struct dbt' to 'struct DBMap' and 'DB' to 'DBMap*' - changed 'struct db' to 'struct DBMap_impl' and 'DB_impl' to 'DBMap_impl*' - changed COUNT to DB_COUNTSTAT and made it's existence not depend on DB_ENABLE_STATS - removed some @see links and corrected small typos in the documentation git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11698 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-03Added script function 'strnpcinfo', for increased npc awareness (originally ↵ultramage1-0/+46
from jAthena). Updated script reference doc. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11650 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-02Fixed one wrong return value in buildin_getcharid (bugreport:33)ultramage1-6/+7
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11638 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-02Moved the BUILDIN_DEF() block to the end of script.c.ultramage1-671/+352
Removed the big list of BUILDIN_FUNC() declarations in script.c, as they are not needed anymore and no code utilizes them => file size-= 11 kB. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11637 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-31- Fixed the pc_additem weight check breaking when your current weight is ↵skotlex1-2/+5
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-46/+48
* 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-27* Fixed TXT charserver doing periodic random-sized memory allocation ↵ultramage1-7/+2
(bugreport:312) * Set 'Create Converter's produce success rate to 100% (bugreport:302) * Added check that verifies weapon/ammo/state requirements also when casting finishes (might have unwanted side-effects tho'!) (bugreport:228) * Fixed Firewall knocking back undead/fire element mobs (bug in r11578) * Added dummy 'openmail' to txt server to fix a script error message git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11585 54d463be-8e91-2dee-dedb-b68131a5f0ec