summaryrefslogtreecommitdiff
path: root/src/map/npc.c
AgeCommit message (Collapse)AuthorFilesLines
2011-05-17* Improved error reporting during monster database and spawn data reading.ai4rei1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14827 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-05-14* Moved bitfield 'boss' inside 'spawn_data' and 'mob_data' into the ↵ai4rei1-1/+1
respective state struct (from r13813, follow up to r14795). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14818 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-05-14* Some NPC event related cleaning.ai4rei1-10/+10
- Made event label deprecation message a warning rather than an error, as the scripts still work regardless of whether '::On' is used or not (since r6592). - Introduced constant EVENT_NAME_LENGTH (51) for all event name struct fields to eliminate size inconsistency across all objects (was 50 and 51). - Fixed event names, that are considered special attributes, were not wiped when the value was 0 (since r5707). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14817 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-05-14* Fixed map-server printing deprecation message, when monster event label ↵ai4rei1-0/+8
was used as transport for special attributes (small/large monsters etc.) in script command 'monster' and related commands (bugreport:1274, since r6592, related r5707). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14814 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-20* Random accumulated tweaks and fixes.ai4rei1-2/+6
- Added a error message to npc_enable, to spot disablenpc/enablenpc/hideoffnpc/hideonnpc on non-existing NPCs (related r14750). - Replaced inlined npc_name2id code with calls to npc_name2id. - Open Buying Store skill is now exempted from noskill mapflag like Vending as well (bugreport:4815, follow up to r14713). - Fixed signed constant being returned as unsigned value in get_percentage (bugreport:4765, since r12679). - Replaced strlen checks, which checked whether or not a string is empty, with first-byte checks. - Fixed enabling 'fakename' not clearing party and guild name and cleaned up atcommand 'fakename' code. - Cleaned up party/guild name code in clif_charnameack (follow up to r14737). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14751 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-15* Fixed monsters getting warped when stepping on an NPC warp when at least ↵ai4rei1-1/+1
one of the bits of setting 'mob_warp' was set (bugreport:4766, since r12757). - Fixed option 'monster_ai' referring to setting 'mob_npc_warp' rather than 'mob_warp' (follow up to r8135). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14744 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-03-14* Fixed a typo in npc_touchnext_areanpc (NPC's map being used as it's ↵ai4rei1-1/+1
x-coordinate), which caused ::OnTouch_ invokation to affect different area than intended (bugreport:4814, since r14097). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14743 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-02-06* Fixed NPCs with closing parenthesis in their name could not be duplicated ↵ai4rei1-2/+7
(bugreport:3235). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14695 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-01-14* Replaced remaining occurences of '-1' with 'INVALID_TIMER', where ↵ai4rei1-14/+14
appropriate (follow up to r12998). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14670 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-30* Fixed improper use of itemdb_search. It does not return NULL but a dummy ↵ai4rei1-1/+1
item, if the item id is invalid. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14642 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-26* Fixed items, that get dropped at 100% chance, being reported in @iteminfo ↵ai4rei1-2/+2
as 'available in the shops only' (since/replaces r3482). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14627 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-23* Fixed server processing the sell list (deleting items and giving zeny) for ↵ai4rei1-62/+104
script-controlled shops (OnSellItem), causing the controller script to fail (bugreport:4656, since r6557). - This also makes the server first check the sell list and only continue, if all items can be processed, thus no longer causing incomplete deals and the need for client disconnection in such case (since r6557). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14617 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-22* NPC shop buy list received from the client is now validated for scripted ↵ai4rei1-2/+8
shops (OnBuyItem), before the control is transfered to the script, as well (bugreport:3680, since r5841, related r8525). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14616 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-22* Resolved random compiler warnings.ai4rei1-4/+4
- Silenced pointer size mismatch gcc warning for variables passed to script_setarray_pc (bugreport:4661, since r14613). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14615 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-21* Added script_setarray_pc for setting temporary character array variables ↵ai4rei1-9/+17
outside of script.c without requiring them to use script-interal code (add_str and reference_uid). - Applied script_setarray_pc to assignment of dynamic shop arrays (related r5841). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14613 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-21* Fixed dynamic shop arrays @bought_nameid, @bought_quantity, @sold_nameid ↵ai4rei1-0/+12
and @sold_quantity not getting reset to zero before use, thus providing attached script with wrong/old data, if it did not clear them by itself in previous call (bugreport:1574, since r5841). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14611 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07* Reverted r14563, due to multiple issues which render the source ↵ai4rei1-5/+5
malfunctioning or uncompilable. To be redone later (bugreport:4627). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14567 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07Changed almost all instances of sprintf() to snprintf().Paradox924X1-5/+5
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14563 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-03* Removed leftovers of the item_value_db.txt feature (bugreport:2031, since ↵ai4rei1-6/+2
athena-dev-2.1.1-mod377, followup to pre-svn 2004/05/29). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14553 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-02* Fixed mapflags not getting initialized upon @reloadscript (bugreport:2247, ↵ai4rei1-0/+3
since r1275). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14548 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-28* Added clr_type enumeration for vanish effect constants.ai4rei1-8/+8
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14517 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-25* Fixed a crash when an unknown map is encountered during parsing a 'script' ↵ai4rei1-2/+12
npc and the script has mismatched curly braces (bugreport:4423, since r11502). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14502 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-23* Labels longer than 23 characters will no longer cause the server to exit ↵ai4rei1-9/+10
immediately (bugreport:4563, since r1213). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14494 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-11-02Applied patch by xazax to clean up various bits of code across mapserver ↵Paradox924X1-2/+1
code. (bugreport:4512) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14438 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-10-21 * Removed unused 'indoors' mapflag (follow-up to r3729).Gepard1-2/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14434 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-10-09Replaced all nullpo_retr() calls which returned 0 with nullpo_ret() calls.Paradox924X1-19/+19
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14414 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-08-20* Commented out code from r14388, as this breaks NPCs that rely on running ↵L0ne_W0lf1-1/+1
global events in duplicates. (IE: WoE scripts) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14390 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-08-20Removed processing for undocumented and unused event 'OnCharIfInit' which is ↵Paradox924X1-1/+0
essentially an alias for event 'OnInterIfInit'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14389 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-08-20Made it so global events don't get executed in duplicates to prevent ↵Paradox924X1-1/+1
unnecessary reprocessing of events that only need to be run once. This potentially reduces the total number of global events by hundreds, even thousands. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14388 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-08-19- Implemented usage of packets 0x7fa and 0x7f7, 0x7f8, 0x7f9. These are used ↵Skotlex1-1/+1
for proper deletion of items as well as movement/spawn packets for Renewal clients. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14383 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-07-31* Implemented three new mercenary skills.L0ne_W0lf1-0/+3
* Added two new monster mercenaries. - Added information for the three new mercenary skills. - Added mercenary skills with cast times to castnodex. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14367 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-04-28Fixed OnTouch doesn't trigger on hiding characters. (bugreport:4208)Inkfish1-2/+5
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14291 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-03-21Added missing checks to stop an infinite free cash point exploit. ↵ultramage1-0/+13
(bugreport:4139) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14266 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-02-062010/02/06Inkfish1-2/+2
* Added official packet to display received expirience. (info provided by papkil) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14240 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-12-08Corrected a variable defined in a header file.ultramage1-4/+4
Cleaned up a bad case of variable recycling. Separated the ALL_WEWISH case from the unrelated sage skill cases (undo of r14183). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14190 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-11-26* NPC event code cleanups.Inkfish1-108/+66
- removed the 'OnMyMobDead' dead code. It's never supported though documented. - removed the 'feature' that events only trigger when the player is in the OnTouch area IF it's specified. It's never documented and breaks official scripts. - some cleanups and bug fixes to OnTouch_. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14173 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-11-24Fixed instances not initializing after reloadscript (bugreport:3522).ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14167 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-11-19- Applied the renewal client support patch from Diablo (eA forum topic 222623)skotlex1-1/+0
- Added support for strcharinfo(3) to retrieve the player's map - Added script command "searchitem" for name item searches. - Moved PACKETVER to src/common/mmo.h as it's needed by the char-server now - Changed the status valX from int to long so that it won't break for pointer-storage in other architectures. - Moved the change party leader code to party.c - A few bugfixes or packet field completions based on my past experience messing around with my server. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14155 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-10-25Reverted renaming foreach functions and create a new one for OnTouch so that ↵Inkfish1-3/+3
last commit will hopefully break NOTHING in use. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14098 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-10-25* Implemented the official version of 'OnTouch' named as 'OnTouch_'.(it can ↵Inkfish1-26/+111
be defined in script_athena.conf) * Adapted 'map_foreachinarea' to 'map_forsomeinarea' so that it allows you to specify the number of bl you wanna operate on. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14097 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-10-24Reverted the previous change to OnTouch not triggering for invisible chars.ultramage1-3/+2
While this is the official behavior for OnTouch (as opposed to OnTouch2 which we don't have), this change would break npcs that assume you can't just walk past them cloaked. If there is a real need for implementing this behavior in the future, it should be done in a backwards-compatible way if possible (although, inverting the meaning of OnTouch/OnTouch2 would cause a lot of confusion). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14096 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-10-24* 'OnTouch' script shouldn't trigger when you are invisible.(same as warps)Inkfish1-5/+9
* Fixed character doesn't stop walking when walking into OnTouch area of an NPC who doesn't have an OnTouch label. (bugreport:2700) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14095 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-08-14- Fixes and optimization to instancing. Thanks to Saithiszephyrus1-0/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14006 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-08-12- Optimization to instance system.zephyrus1-0/+75
* Removed the crc feature to generate instance npc names. The instance npc name will be "dup_" + instanceid + "_" + srcnpcid. * Removed the big array under map structure and coded in a different way. It was only used to generate map names, but i just used the instance_id + "origin map name". * Moved all instance features to separated files. * Moved the npc duplication for instances into npc.c as Ultramage says (removed npcname_db from npc.h). * Added recomendations for scripts commands by Saithis. - Testing required, i will prepare Endless Tower script soon. I hope this do almost anything in bugreport 3276. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14003 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-30Fixed when dynamic_mobs is active, reloading script right after the last ↵Inkfish1-0/+5
player having left a map leads to permanet mobs not spawning on that map.(bugreport:2736) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13921 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-06-20- Instancing System (Thanks to Sirius White who did most of the code, with ↵zephyrus1-1/+1
some of my work to implement client side information, some optimizations and bugfixes). Also thanks to contributions from UEAUP team and Orcao. - Fixed a bug on areamobuseskill and changed it to make it as Aegis. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-25Now we can use 'boss_monster' to summon whatever monsters that need to be ↵Inkfish1-1/+3
radared by Convex Mirror. (bugreport:2653) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13813 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-15- Fixed a bunch of invalid memory access bugs as reported by Valgrind.skotlex1-1/+1
- Updated unit_stop_walking to not move character an extra cell when it is already half-way there unless flag 0x4 is passed. (bugreport:3078) - Fixed the monster MD_CASTSENSOR code not correctly setting the monster's aggressive state. - Corrected a few compiler warnings - Changed a bit the code for SC_BOSSMAPINFO so it is not so hideously ugly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13774 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-15Removed the undocumented custom level feature from monster spawn lines ↵ultramage1-7/+2
(bugreport:3076). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13772 54d463be-8e91-2dee-dedb-b68131a5f0ec
2009-05-10* A typo on my last commitInkfish1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13748 54d463be-8e91-2dee-dedb-b68131a5f0ec