451 Commits

Author SHA1 Message Date
FlavioJS
05134f3dcc * Reworked the parsing at npc.c.
- 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://svn.code.sf.net/p/rathena/svn/trunk@11502 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-17 20:15:39 +00:00
FlavioJS
b445bfa64e >.>
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11489 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-16 17:39:49 +00:00
FlavioJS
7109831b80 * Tweaked the loop in parse_script to better handle when the outer brackets 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://svn.code.sf.net/p/rathena/svn/trunk@11487 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-16 17:32:47 +00:00
FlavioJS
faa553103c * Fixed itemdb_read_sqldb blowing up the server with segmentation faults.
* Added an option for parse_script to ignore the checks for the set of brackets around the script.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11398 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-10 21:51:56 +00:00
ultramage
52a7948f8b * Corrected string lengths according to bugreport:198
- 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://svn.code.sf.net/p/rathena/svn/trunk@11386 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-09 17:45:51 +00:00
ultramage
1069e3524c * the mapserver won't exit when no mapcache is found, with use_grf: yes
* 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://svn.code.sf.net/p/rathena/svn/trunk@11374 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-06 15:35:31 +00:00
ultramage
286e1a32c4 * Added MAX_HOTKEYS to supplement the HOTKEY_SAVING define
* 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://svn.code.sf.net/p/rathena/svn/trunk@11353 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-04 16:16:44 +00:00
zephyrus
383f017009 * Moved the homunculus shuffle code to mercenary.c, fixing the bug in the 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://svn.code.sf.net/p/rathena/svn/trunk@11350 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-03 21:47:47 +00:00
FlavioJS
0498cb19c0 * Reimplemented mmo_char_fromsql using sql statements. (fixes bugreport:93)
* 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://svn.code.sf.net/p/rathena/svn/trunk@11311 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-27 11:18:58 +00:00
FlavioJS
beda52e6b3 * map_addflooritem and struct item_drop_list using id's instead of struct map_session_data's (fixes bugreport:36).
* Fixed buildin_escape_sql not properly escaping in sql servers.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11279 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-23 03:14:57 +00:00
ultramage
961f23767d * Added 'safestrnlen' to prevent null pointer crashes
* 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://svn.code.sf.net/p/rathena/svn/trunk@11271 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-22 11:02:26 +00:00
FlavioJS
b848357f20 * Added a sanity check for MAX_ZENY (doesn't compile if too big).
* Redid the buildin_query_sql function. (fixes bugreport:81).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11268 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-22 01:43:08 +00:00
FlavioJS
65642f6f1c * Merged the tmpsql branch:
- 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://svn.code.sf.net/p/rathena/svn/trunk@11245 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-20 11:09:36 +00:00
skotlex
8105f340a2 - Applied various crash-protections to script commands that deal with the 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://svn.code.sf.net/p/rathena/svn/trunk@11230 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-17 19:13:58 +00:00
ultramage
562e687322 Added config option 'quest_exp_rate' to adjust exp gained by the 'getexp' script command (followup to r11165).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11171 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-10 18:11:10 +00:00
skotlex
7233562a1a - Removed bonus bAddEffWhenHitShort as it is unneeded and unused.
- 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://svn.code.sf.net/p/rathena/svn/trunk@11169 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-10 17:07:35 +00:00
skotlex
574c76e799 - Added support for the new party invite/reply packets from the latest 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://svn.code.sf.net/p/rathena/svn/trunk@11134 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-07 07:31:58 +00:00
skotlex
5748269898 - Merged @whereis from my server (displays normal spawn maps for given 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://svn.code.sf.net/p/rathena/svn/trunk@11110 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-09-03 03:35:42 +00:00
skotlex
f6c97de344 - Oops, forgot a very important check in homevolution D:
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11092 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-30 05:01:39 +00:00
skotlex
d25b5ad103 - Cleaned up a bit the homunculus evolution code, and fixed homevolution 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://svn.code.sf.net/p/rathena/svn/trunk@11090 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-30 04:39:59 +00:00
ultramage
0072a0189e * Cleaned/clarified some #include relationships between headers
* 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://svn.code.sf.net/p/rathena/svn/trunk@11040 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-19 12:55:29 +00:00
ultramage
8076b535d4 * Fixed npc chatrooms not being deleted on npc unload/reload (crash)
* 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://svn.code.sf.net/p/rathena/svn/trunk@11023 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-16 14:14:11 +00:00
ultramage
56d9a037a6 * Some serious code cleanups
- 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://svn.code.sf.net/p/rathena/svn/trunk@11017 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-15 17:13:04 +00:00
ultramage
c8ff534024 - stable -> trunk sync
- 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://svn.code.sf.net/p/rathena/svn/trunk@10971 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-09 18:56:27 +00:00
ultramage
bc31c68ad5 The new functions now clear junk from the output buffer, this simplifies the code a bit.
Added a TODO for one emblem loading problem/crash.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10969 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-09 11:02:44 +00:00
ultramage
f5f77a5d51 * Cleaned up junk left in the code by the mapcache/mapindex update
- Added mapindex_getmapname(_ext) to help with ".gat" adding/removing
- Moved related processing to the interface (prevents duplicity)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10963 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-08 17:41:49 +00:00
skotlex
9e9847a83e - Fixed some missing max levels for npc skills
- 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://svn.code.sf.net/p/rathena/svn/trunk@10961 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-08-08 01:55:58 +00:00
ultramage
ef0fff1720 * Removed ridiculous refine_posword config switch
* 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://svn.code.sf.net/p/rathena/svn/trunk@10923 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-28 19:21:40 +00:00
ultramage
5ba6e5f949 Fixed yet another script engine typo, this time in 'copyarray'
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10878 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-13 18:29:28 +00:00
ultramage
a07af78342 * Fixed typo in 'deletearray' messing up the script engine
* Added a check to pc_skill() to prevent crashes on unknown skill ids

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10868 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-08 19:24:48 +00:00
ultramage
4fced6485a Fixed a copy-paste typo messing up script variables pretty bad D:
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10850 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-04 08:04:55 +00:00
ultramage
aa3f4c7b18 Fixed a typo in script engine erroring when working with char params
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10848 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 19:26:08 +00:00
ultramage
8db83e248a - Re-coded 'soundeffectall'; removed the third parameter ('coverage')
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 15:15:23 +00:00
FlavioJS
f8e09d76d0 * Defined out a problematic piece code in conv_num.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 01:54:46 +00:00
FlavioJS
bde6a0ca4b * Added reporting of constant and param script data.
* Fixed an incorrect check in menu script command.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10842 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-03 00:18:51 +00:00
ultramage
1ed7f6c584 Cleaned up some parts of the code.
Removed obsolete script function 'hasitems'.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10838 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-01 15:26:53 +00:00
FlavioJS
a75ec9a547 * Changed the string hash of the script engine to SDBM.
* Reporting information about script data when an error occurs.
* More work on ticket #41 (array functions).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10813 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-26 21:03:31 +00:00
FlavioJS
2d1ad607c3 * Fixed script command sc_end not supporting the extra argument as stated 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://svn.code.sf.net/p/rathena/svn/trunk@10773 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-15 21:26:17 +00:00
FlavioJS
3e13b73efe git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10706 54d463be-8e91-2dee-dedb-b68131a5f0ec 2007-06-06 16:53:09 +00:00
ultramage
e1397576e6 - Fixed missing client update when 'return to savepoint' fails
- 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://svn.code.sf.net/p/rathena/svn/trunk@10668 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-03 14:43:34 +00:00
FlavioJS
f68f40f94d * Displaying op names instead of numbers in script engine errors.
* 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://svn.code.sf.net/p/rathena/svn/trunk@10667 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-06-02 20:19:40 +00:00
ultramage
0b618b9425 - Fixed @statall giving you +99 stats instead of setting them to 99
- Fixed npctalk and @npctalk displaying the # part of the name

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10619 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25 20:54:47 +00:00
ultramage
ffbf79b895 Reformatting, warning fixes, unsigned char removal
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10618 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25 19:37:58 +00:00
ultramage
dfdb5368c7 Corrected some weird fgets() statements, plus reformatted them
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10616 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25 15:21:53 +00:00
ultramage
301d493855 - Added new flag to skill_castnodex.txt, to allow per-skill tweaking of cast 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://svn.code.sf.net/p/rathena/svn/trunk@10613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-23 21:23:36 +00:00
ultramage
4228b025e7 - Fixed one missed malloc->aMallocA typo, causing memory deallocation problems
- Some small trunk-stable formatting synchronization

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10595 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-20 20:40:34 +00:00
ultramage
711d01a128 Reformatting @_@
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19 15:50:41 +00:00
ultramage
16671ef54f * Added Global chat and Main chat logging
- lowered the priority of the 'logging off during gw' filter

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10580 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19 13:26:02 +00:00
ultramage
bac04aa3aa Corrected the problem with countitem2 (value wrapped-around in one case but not in the other, making comparisons fail)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10573 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19 07:46:57 +00:00
FlavioJS
e54e285849 * Fixed warpwaitingpc not working (bug introduced in r10471).
there was a "sd != NULL" where it should be "sd == NULL"

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10499 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-07 05:18:39 +00:00