922 Commits

Author SHA1 Message Date
skotlex
29cb0abe60 - Added player not attached crash prevention to countitem/countitem2
- Probably corrected delitem not deleting pet eggs at all.
- Possibly nullpo fix on npcskilleffect
- Corrected a warning when using #fakename
- Hopefully fixed hidenpc/disablenpc not working on Guild flag sprites.
- Mob skill state "anytarget" no longer triggers when the mob has an item-target (looting).


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9991 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-11 22:21:34 +00:00
skotlex
ddfc677c99 - @storage/@gstorage will no longer work if you have a trade or a storage opened already.
- Cleaned up a bit @gstorage
- Added a bunch of npc functions required to properly handle moving the NPC cells when an npc is moved from it's previous location.
- Added npc_setcells to handle setting down the NPC cells of ontouch npcs.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9990 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-11 20:02:42 +00:00
FlavioJS
2b42ec13cf - Added info on packet 0x86 (simple move packet). Not usable until a clear separation between entering sight/leaving sight/walking in sight is done.
- Propagating const char* from the script engine.
- ".gat" is appended to the map name before sending the changemapserver packet to the client.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9979 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-09 01:49:50 +00:00
skotlex
9387ff566b - Made conv_str return const char* since the script engine screws up if you mess with the position of the terminator on the received string.
- Because of this, many functions that handled the return of conv_str need to be changed, I haven't finished doing the conversion process because I must go already, if someone else can continue, please do so (I will resume work on this in ~5 hours


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9978 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-09 00:10:06 +00:00
skotlex
b10091246c - Normalized the mapname in guild get/set castle data, should fix guild flags.
- Added log options 0x800/0x1000 to log storage moves ('R') and guild storage moves ('G')
- Added upgrade_svn9976.sql to include 'R'/'G' on the picklog type column set.
- Updated the logs_athena description to include the letter of each type (512 - M, 32 - N, etc)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9976 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-08 16:27:06 +00:00
skotlex
4dd0c95c58 - Modified set_reg so that it returns whether it succeeded or not in setting the requested variable.
- Externalized battle skill range and blewcount bonus into their own static functions (battle_range_type & battle_blewcount_bonus).
- Sped up the skill range flag setting code.
- Added automatic support of damagesplit. This means that if a skill's nk value includes damage split among targets, it will do a divide by the number of targets (whereas before the list of skills where this worked was hardcoded)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9950 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-02 16:39:33 +00:00
ultramage
4ca0b15de3 EOL-styled some more files
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9947 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-02 00:11:54 +00:00
Lupus
7beec2d152 added setiteminfo function, updated setitemscript func, added NPC sample for them
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9938 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-28 22:31:55 +00:00
skotlex
155552d89f - Fixed the definition of warpwaitingpc so that it allows an optional argument (number of people to warp).
- Modified the Palm Strike packet so the initial hit animation does not displays "Miss".


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9935 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-28 16:24:39 +00:00
FlavioJS
d6b5fe4b78 - infinite loop pwned me x.x
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9919 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-25 21:16:37 +00:00
FlavioJS
8f8fca4481 - Fixed a compiler warning in char_sql\login.c
- Minor source documentation/cleanup.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9917 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-25 15:38:12 +00:00
ultramage
32618b7ddd Corrected some typos and small details
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9912 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-25 03:23:45 +00:00
FlavioJS
8723e53a06 - Minor cleanup/documentation on the script engine.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9909 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-24 11:59:32 +00:00
skotlex
cf8685131d - Minor cleanups
- Adjusted menu-based skills so you can't reuse the same skill until you've dealt with the menu.
- Adjust autospells so that removing an autospell works when the script of the card that removes the autospell is triggered before the script that adds the spell.
- The "requested name of gm-hidden char" warning will not be displayed when the object in question is an NPC (since you can use Intravision to do this).
- Corrected the header format for invisible npcs.
- Venom Knife no longer takes into accounts cards or EDP.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9905 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-23 18:41:56 +00:00
skotlex
5ed686f6a8 - Updated the Dancer job quest to attach a player to the main timer script.
- Updated script commands startnpctimer, stopnpctimer, initnpctimer so you can attach a player to them, this is done because the attach/detach functions can't be used to attach to a different script than the one currently running.
- Some script code cleaning
- Updated the script_command reference with the new flag values of [start/stop/init]npctimer.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9872 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-16 20:53:05 +00:00
skotlex
dddd48f15d - Modified the "guardian" spawn script command, it no longer receives a "amount" argument (since that only leads to trouble), if the class is negative, it'll pick a random class the same way the monster spawn script command does, and if you pass a spawn position with coordinates equal or less to 0, a random spot in the map will be taken. However you can't use "this" as a map name anymore since these script commands do not need an attached player.
- Guardian spawning will now fail if you attempt to spawn a guardian that already exists on the same position.
- Collapsed clif_party_main_info and clif_party_join_info into a single function: clif_party_member_info
- Collapsed config settings "sg_miracle_skill_min_duration" and "sg_miracle_skill_max_duration" into "sg_miracle_skill_duration", which defaults to an hour.
- Miracle of the Sun, Moon and Stars can now retrigger to lenghten it's effect, and it is cancelled on warp/map-change.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9871 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-16 19:30:28 +00:00
ultramage
d47a72bf9f Cleaned up set_reg and the surrounding code
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9869 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-15 20:54:36 +00:00
skotlex
dabaf379a9 - The default packet version is now 8. Clients from November2006 and before can no longer get past the char-server unless you change it back to 7.
- Fixed Storm Gust counter freezing on fourth hit instead of third.
- Fixed @homstats not taking into consideration that the stat growth decimals get discarded on level up (so the real minimum/maximum displayed was off).


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9868 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-15 18:22:56 +00:00
skotlex
81b4f30221 - Applied Rayce's dangling pointer fix when returning a temporary npc string variable (those starting with .@)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9864 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-13 22:27:30 +00:00
FlavioJS
781fa7bb72 - A bit more work on Ticket #41.
- Added 'r' (variable reference) to the script argument definitions.
- Added a simple define for suspitious actions. (empty at the moment)
- Added clif_clearcart and moved sending cart packets to pc_setoption.
- clif_parse_ChangeCart checking the player level.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9857 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-13 00:07:24 +00:00
FlavioJS
79fd4cb7be - Ups @ last commit. This time the changes in the buildin_func array are automatic, so there should be no more errors due to erroneous manual checking.
( got to remember to do automatic changes more often >.> )

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-10 20:50:37 +00:00
FlavioJS
1041f38037 * Cosmetic changes to the buildin section of script.c (use defines for function names/definitions).
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-10 13:56:49 +00:00
FlavioJS
c46f3cf135 - Removed deprecated console code.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9815 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-07 06:25:00 +00:00
ultramage
6bf7170064 Cleaned up the script engine's get_val() function
- changed the long if-spaghetti into a compact switch statement
- changed its behavior so that it exits if !sd and it requires one
- upon exiting, it will now ensure that meaningful values get returned (the old code would return random memory / crash)
- removed many !sd checks since they are done at the beginning now

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9812 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-07 01:49:28 +00:00
ultramage
c5450173b1 Undid revision r9792 (npcshopattach)
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9796 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-06 00:32:40 +00:00
ultramage
ed7e98e9d3 Applied Dj-Yhn's fix to 'npcshopattach'
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9792 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-05 20:34:22 +00:00
FlavioJS
f652311f37 - Continuing the checking of script buildin functions and stop the script execution when an attached player is required but not found.
This task will be referenced as Ticket #41 from now on.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9790 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-05 17:42:55 +00:00
ultramage
12a784cf17 Changed the 'getpartyleader' script command so that it returns a map name instead of the useless mapindex number.
Also fixed it so that it doesn't throw a 'args of aFree is not valid pointer' error (although I'm not at all sure that the fix is correct).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9787 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-05 14:11:43 +00:00
skotlex
a23da55db8 - Fixed the flag parameter not working on npcshopattach
- Modified unit_walktoxy so it accepts flag &4. When used, this flag will delay the walk request if the character is unable to move because of the can't walk delay. This is used for player and homunculus walk requests.
- Removed the delay walking code from clif.c as it's now handled by unit.c
- Added a possible crash protection in clif_skillfail when the player is without a connection.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-03 07:48:38 +00:00
skotlex
2a5ec09a11 - The define MESSAGE_SIZE was wrong! It is only used for input boxes. Therefore now it is only used for Vending, Talkie box and Graffiti
- Added new define CHAT_SIZE which holds the max length that a client can send from the chat buffer. This value is NAME_LENGTH + 3 (the ' : ') + 70 (the actual text).
- Added define msg_len_check which crops incoming client text if it's longer than CHAT_SIZE. Added cropping to all incoming messages except normal chatting which is already accounted for.
- Removed variable  talkie_mes, this is now handled by sd->message
- Cleaned up parser functions for /b /lb, gm kick, /shift, /recall
- Added crash protection to the logging functions when they receive a too long string.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9778 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-02 19:59:39 +00:00
skotlex
4130bdd3b8 - Cleaned up the npcshop(add/del) item script commands, fixed a possible dangling pointer crash caused by their improper use of realloc. They no longer automatically attach the script to the shop, and they will return true/false based on whether the shop was found or not.
- Added script command npcshopattach to enable attaching/detaching your script from any npc shop.
- Updated doc/script_commands.txt with entries for npcshopitem, npcshopadditem, npcshopdelitem and npcshopattach 


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9769 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-01 22:23:14 +00:00
DracoRPG
bf98b03fb0 Removed useless read-from-GRF features
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9725 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-27 05:04:10 +00:00
skotlex
f904054ce8 - Improved a bit the menu entries counting code (using a while with strchr should yield better performance that a for done on the string's strlen, right? However, it bugs me that strchr's man-page says it won't work on multi-byte characters. But does a strchr(str,':') works any worse than (str[i]== ':')?
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-24 15:11:42 +00:00
skotlex
81a9313a9d - Removed sd->max_menu, sd->npc_menu is now reused to store what is the max number of valid entries and prevent clients from picking invalid options.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-22 15:10:15 +00:00
FlavioJS
5117e39fac - Fixed while statements not "reserving" the curly before parsing the test expression.
Ref: http://www.eathena.ws/board/index.php?showtopic=134596

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9680 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-21 03:17:04 +00:00
skotlex
3838afbf52 - Fixed the label dup code, it now works correctly with const.txt switch labels.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9676 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19 18:22:31 +00:00
skotlex
9d049827d7 - Reverted the dup-label check code since it has a bug that needs to be fixed first (it fails to recognize const.txt values)
- Reverted clif_skill_damage receiving the blewcount value since the whole code update that was involved didn't help any anyway.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9675 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19 18:00:11 +00:00
skotlex
3b1e03537d - Merged Rayce's cleanups of the script engine that account for duplicate labels, non-numeric labels and makes the engine case-insensitive towards keywords like if/case/switch/etc/
- Added the icons for the Food boosts (need packet version 8 to get them).


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9673 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19 15:27:53 +00:00
FlavioJS
8d7a0bd454 - Fixed the script engine not parsing strings in multibyte charsets correctly (should have been done in r9532).
Ref: http://www.eathena.ws/board/index.php?showtopic=132004

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9642 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-11 08:34:34 +00:00
FlavioJS
aa371b3af3 - Fixed the define script_lastdata, introduced by me at r9637 (had the wrong sign)
really hate these types of bugs, no more committing late for me >.>

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-10 14:57:54 +00:00
FlavioJS
4b78fc3c9f - Changes to script buildin functions:
* functions checking if a player is attached as soon as possible.
  * functions that required a player attached and would crash if none was 
    there terminate the script now. (others keep the current behaviour to 
    maintain full backward compatibility)
  * removed the unused flag argument in guildskill.
  * bonus,bonus2,bonus3,bonus4 use the same function now (remains the same 
    script-wise)
  * added an optional parameter to setcart,setfalcon,setriding so it's 
    possible to remove the cart/falcon/mount or select a specific cart
  * other cleanups

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9636 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-09 17:31:13 +00:00
ultramage
b0aa97039b Unimportant cleanups
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9633 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-08 16:50:54 +00:00
FlavioJS
da5d22b67f - Fixed the sleep timers not being removed when the an npc was being unloaded and when reloading scripts.
Ref: http://www.eathena.ws/board/index.php?showtopic=131464

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9629 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07 17:59:25 +00:00
ultramage
fbe23f27a2 Undid the memset->malloc_set replacement
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9626 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07 16:49:03 +00:00
ultramage
9f164c312b - re-added the duplicit nj/gs name messages in msg_athena
- renamed atcommand_sub to is_atcommand_sub (charcommand too)
- reformatted conf-tmpl's comments a bit
- and a fix to the stable changelog to make my last commit more descriptive

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9625 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07 07:48:04 +00:00
FlavioJS
0cf60d9ca1 - Updated getitem and guardian entries in script_commands.txt.
- Fixed getitem trying to get <character ID> from the wrong argument.
- Now getitem can be run on scripts without a player attached if <character ID> is specified.
- Now the two last arguments of guardian are optional and independant of each other ("<event label>" and <guardian index>). This way the previous implementation and script_commands definition are still valid code.
- Now buildin function names and argument definitions are checked for validity before adding the function to the script engine.
  Argument definitions follow the pattern:
    (v|s|i|l)*\?*\*?
    v - value (string or int)
    s - string
    i - int
    l - label
    ? - one optional parameter
    * - unknown number of optional parameters

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9599 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-31 09:22:25 +00:00
FlavioJS
f863581174 - Part 3 of TheUltraMage's socket cleanup.
- Fixed the packet structure in mmo_char_send006b for PACKETVER 8.
- Removed search_str from add_str (add_str already searches for the string).
- Native script words like do,while,for,... are case insensitive now.
- Changed SCRIPT_HASH_SIZE to 1021 (prime hash sizes give better distributions).
- Added alternative hash implementations to the script engine (to try out later).

removed int_homun.c from header section of the VS8 map project files

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9588 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-28 19:11:40 +00:00
skotlex
74e263086a - Applied Rayce's suggestion to improve the script hash size usage. eA now uses a hash of 1024.
- The str hash report can be printed by turning on the etc_log


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9577 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-27 14:40:04 +00:00
skotlex
58bb9be68a - Cleaned up some more the code so it works for -DTURBO
- Cleaned the pvpoff @ and script commands.
- mob_get_random_id now has two additional flags to specify that the monster to acquire should not be a boss type (4) or that it should give exp (8).
- TK_MISSION will now pick any mob from the DB as long as it is not a boss type and it gives base exp.
- Fixed the double-stone issue when hitting a petrified character.
- Minor cleanups


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9573 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-26 15:07:18 +00:00
FlavioJS
dd92bd13fd - a couple of warnings fixed
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9572 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-25 08:21:49 +00:00