summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-18Fixed numerous /W4 warnings (and created more :)ultramage1-3/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11514 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-18Some code cleaning...ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11505 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-17* Reworked the parsing at npc.c.FlavioJS1-9/+11
- Fixes npc.c discarding the '}' at the end of file, when there is no newline. (uncovered as a side-effect of r11487) * Empty script functions always have code now (won't report as missing when you try to call them). * Changed userfunc_db to not limit the name to 50 characters. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11502 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-16>.>FlavioJS1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11489 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-16* Tweaked the loop in parse_script to better handle when the outer brackets ↵FlavioJS1-3/+9
aren't checked. * Fixed a typo in skip_space that stopped skipping characters when it encountered a '*' or '/' in a block comment. ex: /* this will give a parse error after this character->* */ /* same thing here->/ */ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11487 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-10* Fixed itemdb_read_sqldb blowing up the server with segmentation faults.FlavioJS1-12/+28
* Added an option for parse_script to ignore the checks for the set of brackets around the script. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11398 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-09* Corrected string lengths according to bugreport:198ultramage1-20/+20
- CHATBOX_SIZE: 70 -> 70+1 - removed some too aggressive checks in clif_parse_globalmessage() - removed CHAT_SIZE define as it actually doesn't apply anywhere - added CHAT_SIZE_MAX to serve as a custom limit to input string lengths - added length/contents checks to /b and /lb (against fake names) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11386 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-06 * the mapserver won't exit when no mapcache is found, with use_grf: yesultramage1-122/+65
* Fixed some \r uses, now looks better; /thx to Ai4rei (topic:165952) * Removed that ridiculous spinner that displays during map/npc loading, and added a more informative progress indicator (idea from jA/eapp) * Checked/fixed/removed some old script and npc commands * cmdothernpc - a specialized 'donpcevent' with the event specified as two arguments * enablearena/disablearena - completely equivalent to enablewaitingroomevent & co. * inittimer/stoptimer - removed since its logic was incompatible with the code it depended on * Removed loads of code that supported these functions. Result: -100b per npc => -1,5MB of wasted memory * Fixed related npcs that erroneously used 'stoptimer' git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11374 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-04* Added MAX_HOTKEYS to supplement the HOTKEY_SAVING defineultramage1-0/+1
* Fixed a compile problem when hotkey saving is disabled (topic:167265) * Added script source error reporting to countitem() (topic:167165) * Removed integer mob skill state/target definition support (unused) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11353 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-03* Moved the homunculus shuffle code to mercenary.c, fixing the bug in the ↵zephyrus1-0/+13
atcommand not using the bonus evolution stats for homunculus. * Added a new script command "homshuffle" to reset the homunculus stats using NPC. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11350 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-27* Reimplemented mmo_char_fromsql using sql statements. (fixes bugreport:93)FlavioJS1-0/+2
* Fixed buildin_gethominfo not being included in the script engine. (bugreport:124) * homunculus_evolution -> homevolution in script_commands.txt. * Deleted item DEFAULT from item_db.txt and regenerated item_db.sql. (bugreport:103) * Skip empty lines and give more feedback (for invalid lines) when reading item_db.txt/item_db2.txt. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11311 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-23* map_addflooritem and struct item_drop_list using id's instead of struct ↵FlavioJS1-14/+20
map_session_data's (fixes bugreport:36). * Fixed buildin_escape_sql not properly escaping in sql servers. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11279 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-22* Added 'safestrnlen' to prevent null pointer crashesultramage1-1/+1
* Fixed global chat logging always crashing on a null pointer * Applied changes to clif_parse_globalmessage() from my WiP code - clearer processing of the individual packet components - proper code ordering, some more integrity checks - fixes to some poorly chosen ShowWarning() format strings - global chat logging no longer logs the entire string (w/ player name) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11271 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-22* Added a sanity check for MAX_ZENY (doesn't compile if too big).FlavioJS1-47/+75
* Redid the buildin_query_sql function. (fixes bugreport:81). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11268 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-20* Merged the tmpsql branch:FlavioJS1-196/+176
- Abstraction for the sql code (sql.c/h). - New configure script and makefiles. - Restored txt zeny logging code. (r10814) - Rewrote mapserver's sql code - itemdb, mobdb, mapreg, logs. (r10814) - Fixed a precedence issue (&& and ) in char_sql/char.c. (r10833) - Improved db reading code a bit for consistency. (r11077) - Added separate atcommand for mail deletion. (r11077) - Corrected a few messages that said "new" instead of "unread". (r11077) - Broadcast (*) messages now use "*" as the target's name (not ""). (r11077) - Moved StringBuf code from utils.c/h to strlib.c/h. (r11084 r11117) - Some misc login server cleanups (reformatting etc). (r11136) - Corrected/modified some header entries. (r11141 r11147 11148) - Adjusted VS project files. (r11147) - Adjusted the way the sql charserver does item saving. (r11192) - Corrected usage of reserved keyword 'friend' in mmo.h. (r11192) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11245 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-17- Applied various crash-protections to script commands that deal with the ↵skotlex1-38/+67
equip-position array. - Corrected and simplified the skill_magic_reflect function. Fixed damage reflection being based on the caster rather than the target. - Potions are now usable inside Gospel by the casting Paladin (as per Aegis tests done by AuronX) - The unequip script command now takes a position from 1 to 10 rather than 0 to 9 (to make it consistant with all the other equip position related script commands) - Added the EQI_* constants to db/const.txt in a format usable by the equip-position related script commands. - Updated some items to use the new EQI constants. - Also updated doc/script_commands.txt to refer to the EQI list. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11230 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-10Added config option 'quest_exp_rate' to adjust exp gained by the 'getexp' ↵ultramage1-2/+10
script command (followup to r11165). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11171 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-10- Removed bonus bAddEffWhenHitShort as it is unneeded and unused.skotlex1-16/+57
- Corrected getpetinfo so it actually returns "null" when there's no pet and you request the name (the docs state it so). - Also cleaned up a bit getpetinfo - Added gethominfo (which behaves in the same way as getpetinfo). - The 'maxcount' skill_db field now can store independant values per skill-level, required for Kamaitachi since it uses different range values per level. - Corrected bonus3 bAutoSpell(WhenHit) to select target enemy (rather than self) for skills with inf self and inf2 'don't target self' (aka: auto-select target skills). - Corrected map_foreachinpath to do a wall check for targets beyond the initially selected tile. - Corrected Kamaitachi's range to be 9, and the path range to be 4+SkillLv git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11169 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-07- Added support for the new party invite/reply packets from the latest ↵skotlex1-3/+3
client version. - Cleared up some TODO's - Added auto-rejecting party/guild invites when the target is disconnected from the server. - Added a correction in the walking code to abort it when map_moveblock cancels the player's walking (by warping/knocking back),the default code would fail because unit_stopwalking would do nothing since the walk timer was already -1 in that moment. - Corrected mob_randomwalk to use unsigned int for the tick variable. - Changed the default @Main format to prevent crashes in the newer clients. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11134 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-03- Merged @whereis from my server (displays normal spawn maps for given ↵skotlex1-2/+7
mobs). This command should be working correctly considering I've been using it since July. I was meant to merge it as soon as I got my hard-drive back, but I kinda forgot @_@ - bonus3 autospell (and autospell when hit) will change the target to self when the skill to be casted is inf&4 (self skill). - Corrected script homevolution not making the homunculus /swt if it is invoked when not loyal. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11110 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-30- Oops, forgot a very important check in homevolution D:skotlex1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11092 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-30- Cleaned up a bit the homunculus evolution code, and fixed homevolution ↵skotlex1-4/+2
allowing the homunc to 're-evolve' even though it was already evolved. - Optimized a bit the skillheal code in regards to Apple of Idun and Sanctuary git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11090 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-19* Cleaned/clarified some #include relationships between headersultramage1-39/+2
* Changed clif_sitting() to use 'bl' instead of 'sd' (for non-player objects) * Removed way messed-up script function 'unitdeadsit' * Tagged 'FIXME' lines written by myself git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11040 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-16* Fixed npc chatrooms not being deleted on npc unload/reload (crash)ultramage1-4/+3
* Modified chat code a bit for more clarity - replaced double-indirection on 'owner' with a normal pointer - separated some common functionality to 'chat_createchat()' git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11023 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-15* Some serious code cleanupsultramage1-1/+1
- adjusted @reloadbattleconf to not depend on variable ordering - changed all battle vars to 'int' (removes pointless duplicit coding) - added min, max and default columns to battle config data structure - added properly bounded values for these columns (or at least tried to) - battle-conf loading will now complain if it finds unknown settings, and will reject values that are outside of the allowed range - added CHATROOM_TITLE_SIZE and CHATROOM_PASS_SIZE - partially cleaned up chatroom manipulation code * Fixed 'Job_Professer' typo in mage jobchange quest git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11017 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-09- stable -> trunk syncultramage1-2/+2
- battle.c and pc.c formatting - fixed one badly defined npc shop format string - removed the "selling item for no buying price" warning when the item has a buying price of 20 (see topic:157465) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10971 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-09The new functions now clear junk from the output buffer, this simplifies the ↵ultramage1-3/+4
code a bit. Added a TODO for one emblem loading problem/crash. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10969 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-08* Cleaned up junk left in the code by the mapcache/mapindex updateultramage1-25/+13
- Added mapindex_getmapname(_ext) to help with ".gat" adding/removing - Moved related processing to the interface (prevents duplicity) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10963 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-08- Fixed some missing max levels for npc skillsskotlex1-3/+26
- Expanded isloggedin script command to support an optional argument (char id) - Expanded warpparty command to accept target "Leader", this will warp the party to the leader. - Added a summon structure to handle non-dead-branch mob-groups since the current implementation totally fails for mob groups that don't have MANY integrants - Fixed mobs not attempting an IDLE skill right before unlocking a target. - Removed a useless variable in the pet_data structure git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10961 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-28* Removed ridiculous refine_posword config switchultramage1-618/+223
* TODO: remove getequipname() func, it can be fully replaced by editing a few scripts, plus it doesn't do what the docs say it should do * Fixed a silly mistake in the main script engine loop ('pos' variable) * Fixed monter -> monster typos * Compacted some script function code (fewer LoC -> faster trac :) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10923 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-13Fixed yet another script engine typo, this time in 'copyarray'ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10878 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-08* Fixed typo in 'deletearray' messing up the script engineultramage1-2/+2
* Added a check to pc_skill() to prevent crashes on unknown skill ids git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10868 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-04Fixed a copy-paste typo messing up script variables pretty bad D:ultramage1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10850 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03Fixed a typo in script engine erroring when working with char paramsultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10848 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03- Re-coded 'soundeffectall'; removed the third parameter ('coverage')ultramage1-45/+46
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03* Defined out a problematic piece code in conv_num.FlavioJS1-0/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03* Added reporting of constant and param script data.FlavioJS1-150/+250
* Fixed an incorrect check in menu script command. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-01Cleaned up some parts of the code.ultramage1-25/+0
Removed obsolete script function 'hasitems'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10838 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-26* Changed the string hash of the script engine to SDBM.FlavioJS1-282/+542
* Reporting information about script data when an error occurs. * More work on ticket #41 (array functions). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10813 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-15* Fixed script command sc_end not supporting the extra argument as stated ↵FlavioJS1-104/+147
in script_commands.txt. * Script command getarg supports an extra argument with a default value that is returned if the requested argument doesn't exist. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10773 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-06git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10706 ↵FlavioJS1-2/+2
54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-03- Fixed missing client update when 'return to savepoint' failsultramage1-1/+1
- Fixed a bad copy-paste from r10028 letting players escape jail (char was dead on login, so statuses (SC_JAILED) couln't be applied) - Added clif_standing() to clif_sitting(), and used them in clif.c - Cleaned up clif.c a bit - clif_clearchar->clif_clearunit_area, clif_clearchar_id->clif_clearunit_single git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10668 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-02* Displaying op names instead of numbers in script engine errors.FlavioJS1-9/+59
* Fixed a bug introduced in the last rework of the fame ranking. * Created safestrncpy that ensures the string is nul-terminated. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10667 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25- Fixed @statall giving you +99 stats instead of setting them to 99ultramage1-5/+6
- Fixed npctalk and @npctalk displaying the # part of the name git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10619 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25Reformatting, warning fixes, unsigned char removalultramage1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10618 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25Corrected some weird fgets() statements, plus reformatted themultramage1-3/+6
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10616 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-23- Added new flag to skill_castnodex.txt, to allow per-skill tweaking of cast ↵ultramage1-3/+3
time and delay reducibility by item scripts (cards and such) - Fixed Martyr's Reckoning never triggering for gms with all skills - Added MO_TRIPLEATTACK and RG_SNATCHER to @skillall's skill filter - Made gm_skill_unconditional bypass skill blocking (guild timer, etc) - Reverted the weird delay_dependon_agi thing (r8923, r9055, r9059) - Changed a few memsets to strncpy (reading past buffer is a bad idea) - Sped up some memset operations (multiples of 4 are faster) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-20- Fixed one missed malloc->aMallocA typo, causing memory deallocation problemsultramage1-3/+1
- Some small trunk-stable formatting synchronization git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10595 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19Reformatting @_@ultramage1-435/+230
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19* Added Global chat and Main chat loggingultramage1-1/+1
- lowered the priority of the 'logging off during gw' filter git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10580 54d463be-8e91-2dee-dedb-b68131a5f0ec