summaryrefslogtreecommitdiff
path: root/src/map/script.c
AgeCommit message (Collapse)AuthorFilesLines
2007-03-22Some generic typo fixes (src and npc)ultramage1-5/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10054 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-21- Corrected setitemscript so it actually changes the script as requested ↵skotlex1-64/+66
instead of causing dangling pointers. - Cleaned up unitattack - Made packet_ver_flag's description use hexadecimal values for the packet versions, and changed the default to 0xFFFF. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10047 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-20- getpetinfo 5 will now return the pet's rename flag.skotlex1-1/+4
- Autoloot will now only work on items dropped a certain distance from the player. The distance is defined by AUTOLOOT_DISTANCE in atcommand.h and defaults to AREA_SIZE. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10039 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-20- Removed Magic Rod's cast bar.skotlex1-2/+2
- Corrected warning on login sql. - Gravitation no longer causes damage flinch. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10038 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-19- Removed the last argument from skillitem, the skill name passed to the ↵skotlex1-4/+2
client should always be of the type "AL_HEAL" anyway. - Added skill ITEM_ENCHANTARMS, this is what weapon enchanting items should use. - Corrected itemskill calls in the item_db, also made the weapon enchanting items invoke the ITEM_ENCHANTARMS skill. Corrected Holy Egg not being type 11 (delay consume) - Updated item_db.sql with item_db information. - Added support for specifying different elements per skill level in the skill_db - Added bonus bNoKnockback - Corrected typo in bonus bSubRace2 (it was called bSPSubRace2 for some reason) - Corrected login sql server not resetting your account state to 0 when the banuntil duration expires. - Corrected use of UINT_MAX instead of INT_MAX in some jailing check. - Made the skillatk bonus it's own function, it can now be used to boost Heal/Sanctuary/Potion Pitcher and Slim Pitcher as well. - Cleaned up TK_WARMWIND to use the element acquired from the skill_db rather than hardcoded values. - Corrected Teleport's save map entry being sent without the .gat extension. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10031 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-18Globalised use of script_pushint and script_getdata in script.ctoms1-721/+716
Little clean of unused variables in script.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10026 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-18* Script engine:FlavioJS1-117/+179
- calling functions without using the return value doesn't generate warnings - more work on Ticket #41 * Took care of two warnings and a minor change to the makefile. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10025 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-15- Corrected the structure and added info on the skill fail packet (0x110).FlavioJS1-130/+213
- Added packet 0x223 as clif_upgrademessage (not used yet). - More work on Ticket #41. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10013 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-13Mapcache update, should polish off remaining bugsDracoRPG1-123/+123
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10003 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-11- Added player not attached crash prevention to countitem/countitem2skotlex1-4/+15
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9991 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-11- @storage/@gstorage will no longer work if you have a trade or a storage ↵skotlex1-12/+1
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9990 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-09- Added info on packet 0x86 (simple move packet). Not usable until a clear ↵FlavioJS1-5/+8
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9979 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-09- Made conv_str return const char* since the script engine screws up if you ↵skotlex1-109/+107
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9978 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-08- Normalized the mapname in guild get/set castle data, should fix guild flags.skotlex1-0/+4
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9976 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-02- Modified set_reg so that it returns whether it succeeded or not in setting ↵skotlex1-17/+20
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9950 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-02EOL-styled some more filesultramage1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9947 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-28added setiteminfo function, updated setitemscript func, added NPC sample for ↵Lupus1-7/+67
them git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9938 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-28- Fixed the definition of warpwaitingpc so that it allows an optional ↵skotlex1-2/+1
argument (number of people to warp). - Modified the Palm Strike packet so the initial hit animation does not displays "Miss". git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9935 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-25- infinite loop pwned me x.xFlavioJS1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9919 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-25- Fixed a compiler warning in char_sql\login.cFlavioJS1-46/+61
- Minor source documentation/cleanup. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9917 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-25Corrected some typos and small detailsultramage1-23/+24
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9912 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-24- Minor cleanup/documentation on the script engine.FlavioJS1-29/+65
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9909 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-23- Minor cleanupsskotlex1-5/+2
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9905 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-16- Updated the Dancer job quest to attach a player to the main timer script.skotlex1-38/+105
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9872 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-16- Modified the "guardian" spawn script command, it no longer receives a ↵skotlex1-13/+11
"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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9871 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-15Cleaned up set_reg and the surrounding codeultramage1-72/+58
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9869 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-15- The default packet version is now 8. Clients from November2006 and before ↵skotlex1-19/+0
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9868 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-13- Applied Rayce's dangling pointer fix when returning a temporary npc string ↵skotlex1-0/+6
variable (those starting with .@) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9864 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-13- A bit more work on Ticket #41.FlavioJS1-61/+93
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9857 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-10- Ups @ last commit. This time the changes in the buildin_func array are ↵FlavioJS1-2/+2
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9844 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-10* Cosmetic changes to the buildin section of script.c (use defines for ↵FlavioJS1-962/+1002
function names/definitions). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9843 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-07- Removed deprecated console code.FlavioJS1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9815 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-07Cleaned up the script engine's get_val() functionultramage1-83/+69
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9812 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-06Undid revision r9792 (npcshopattach)ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9796 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-05Applied Dj-Yhn's fix to 'npcshopattach'ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9792 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-05- Continuing the checking of script buildin functions and stop the script ↵FlavioJS1-55/+48
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9790 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-05Changed the 'getpartyleader' script command so that it returns a map name ↵ultramage1-3/+3
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9787 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-03- Fixed the flag parameter not working on npcshopattachskotlex1-2/+2
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9782 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-02- The define MESSAGE_SIZE was wrong! It is only used for input boxes. ↵skotlex1-1/+0
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9778 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-01- Cleaned up the npcshop(add/del) item script commands, fixed a possible ↵skotlex1-60/+95
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9769 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-27Removed useless read-from-GRF featuresDracoRPG1-18/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9725 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-24- Improved a bit the menu entries counting code (using a while with strchr ↵skotlex1-21/+23
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9706 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-22- Removed sd->max_menu, sd->npc_menu is now reused to store what is the max ↵skotlex1-3/+3
number of valid entries and prevent clients from picking invalid options. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9690 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-21- Fixed while statements not "reserving" the curly before parsing the test ↵FlavioJS1-1/+4
expression. Ref: http://www.eathena.ws/board/index.php?showtopic=134596 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9680 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19- Fixed the label dup code, it now works correctly with const.txt switch labels.skotlex1-37/+18
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9676 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19- Reverted the dup-label check code since it has a bug that needs to be ↵skotlex1-3/+32
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9675 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-19- Merged Rayce's cleanups of the script engine that account for duplicate ↵skotlex1-68/+83
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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9673 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-11- Fixed the script engine not parsing strings in multibyte charsets ↵FlavioJS1-3/+3
correctly (should have been done in r9532). Ref: http://www.eathena.ws/board/index.php?showtopic=132004 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9642 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-10- Fixed the define script_lastdata, introduced by me at r9637 (had the wrong ↵FlavioJS1-1/+1
sign) really hate these types of bugs, no more committing late for me >.> git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-09- Changes to script buildin functions:FlavioJS1-297/+330
* 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9636 54d463be-8e91-2dee-dedb-b68131a5f0ec