summaryrefslogtreecommitdiff
path: root/src/map/npc.h
AgeCommit message (Collapse)AuthorFilesLines
2009-06-20- Instancing System (Thanks to Sirius White who did most of the code, with ↵zephyrus1-0/+3
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
2008-12-20* Extended how duplicates work: (based on Orcao's work in bugreport:2361) ↵FlavioJS1-1/+1
[FlavioJS] - you can duplicate warps/shops/cashshops/npcs (before only npcs could be duplicated) - warp duplicates inherit the target location - shop/cashshop duplicates inherit the item list - npc duplicates inherit the script code (backward compatible behaviour) - updated script_commands.txt with the information git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13407 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-31Removed the mob controller system, now a customization (see topic:194375).ultramage1-1/+0
The system consists of * script command to spawn a controlled mob * script commands to attach npcs to such mobs and manipulate their AI * a page of documentation for these commands * callbacks at various source code locations that invoke the attached npcs * two npc examples git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13021 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-06-03- Fixed BugReport 1608. I forgot to merge npc.h sorry.zephyrus1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12755 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-05-29- Added support for NPC with different sizes (setnpcdisplay).zephyrus1-0/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12744 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-27Cleaning up the itemdb reload mess (see r12635, r12643, r12650, r12661, ↵ultramage1-2/+0
r12662, r12663) * the player data inventory-itemdb index is now refreshed using pc_setinventorydata() * mobdb will no longer initialize with nonexistent items, and mobs will no longer drop them in case of a reload * the clif_buylist() function once again hides invalid npc shop items * it is no longer possible to purchase nonexistent items from a npc shop * npc shop loading will not abort if there is a nonexistent item entry, it will just skip over it git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12665 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-27Some major changes to @reloaditemdb to allow unloading of any item while map ↵Kevin1-0/+2
server is running. - Delete any item from inventory/cart/open storages that went missing during the reload. - Delete item from any shop that has this item. - Refresh item screen for anyone who has a shop open. - Delete mob db drop table references. - Delete item from storage during load if it isn't in the item db. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12661 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-24* Reorganized the contents of the mapserver's header files.ultramage1-1/+56
- map.h is no longer a generic dumping spot of all the shared structs, and instead, each such structure now resides in its logical component - map.h now only holds mostly map-related things (needs more cleaning) - there's still a lot of room for improvement (reorganization within individual header files, etc...) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12429 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-13Replaced some foreach-based functions by their inlined iterator equivalents.ultramage1-1/+1
Changed the dynamic mobs system, so that the flag that indicates whether a particular mob can be unloaded is stored in the mob's respawn data structure. Cleaned up related parts of the source code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12358 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-03-12Removed one mob data variable related to dynamic mobs that I found to be ↵ultramage1-1/+1
redundant. Changed MAX_MOBSKILL (max. amount of different skill entries per mob) from 50 to 40 to reduce memory consumption a bit more. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12350 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-28- Added cash shop support. (i need to add documentation, working on it).zephyrus1-0/+2
- An charcommand is still required to add/remove points. - Scripts command only requires to work on #CASHPOINTS and #KAFRAPOINTS. - I called it "Kafra Points" just because it's how comes in the translation. I allready know this changes between Oficial servers. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12264 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-14Applied a temp patch to make some npc-executed atcommands work again ↵ultramage1-1/+0
(bugreport:790). Added support for right-click-gm-menu kicking NPC objects. Removed redundant function npc_checknear2(). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12073 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06Extended the id range for npcs, now [400,700) will also be treated as NPC ↵ultramage1-1/+1
objects (see topic:170845 and bugreport:727). Silenced a compilation warning. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12025 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-12* Some preparations for the guild script updateultramage1-2/+2
- cleaned up npc event execution code - cleaned up guild data loading/saving code; to be improved later - removed dummy 'account name' expulsion list management code - removed columns 'rsv1' and 'rsv2' from guild member data - removed columns 'rsv1' 'rsv2' 'rsv3' and 'acc' from guild expulsion data - added upgrade_svn11895.sql for SQL git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11895 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-06- The default event script behaviour is to trigger on labels rather than ↵skotlex1-2/+2
NPCs now. - Removed several script config options which break NPC compatibility when you mess with them (event_script_type, event_requires_trigger, die_event_name, kill_pc_event_name, kill_mob_event_name, logout_event_name, login_event_name, loadmap_event_name, baselvup_event_name, joblvup_event_name) - LoadMap events no longer set the variable "@maploaded$" to the name of the new map. - Optimized/simplified the code now that the previous config options were removed. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11859 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-27* Fixed fake_nd not being exported correctly and being unloaded when ↵FlavioJS1-1/+1
reloading scripts. (probably fixes bugreport:444) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11816 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-22* Renamed fakenpcname to setnpcdisplay, fixed and extended it. FlavioJS1-1/+2
- See doc/script_commands.txt for information on how to use it git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11779 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-12* Fixed @addwarp crashing the map server (bugreport:390).FlavioJS1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11719 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-11Fixed a missing include/export, and typos in the previous revision.ultramage1-0/+1
Corrected wrong length values in one charserver packet. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11714 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-24* Cleaned up some messy guild code (more to come)ultramage1-1/+1
* Cleaned up the mail code, no more pointless dynamic allocation * Added upgrade_svn11548.sql to convert the mail table to new format * Updated vs7 and vs6 project files * Increased the max. send buffer size to 5M since 1M is not enough * Please complain if something stops working ^^; git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11571 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-17* Reworked the parsing at npc.c.FlavioJS1-3/+2
- 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-06 * the mapserver won't exit when no mapcache is found, with use_grf: yesultramage1-3/+0
* 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-08-19* Cleaned/clarified some #include relationships between headersultramage1-3/+6
* 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-19* Fixed a deallocation mistake and some buffer overflows in npc_chat.c after ↵ultramage1-0/+2
doing rtfm@pcre.txt (all caused by incorrect usage of pcre api) * Removed underscores in npc_chat.c's variable names (easier to read) * Reindented the whole thing (used spaces half of the time ._.) * Moved npc pcre-data deallocation from npc_remove_map to npc_unload git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11036 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-25Reformatting, warning fixes, unsigned char removalultramage1-38/+38
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10618 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-09* Recoded and renamed the trim function in strlib to normalize_name. (didn't ↵FlavioJS1-3/+1
behave like a standard trim function, see function comment for what it does) * Added a proper trim function to strlib. * Other minor cleanups. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10199 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-09* Cleanups at npc source file adding/removing. (one variable has been removed)FlavioJS1-2/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10195 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-01- Fixed the server crashing on startup due to bad defineultramage1-1/+1
- Fixed the server crashing on a timer-queued disguise / undisguise (no sd check) - re-added the item_group_list for consistency's sake, moved to itemdb.h (after some hacking to remove the ugly map.h dependency) - Removed some overly verbose item group messages & code git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10112 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-03-11- Added player not attached crash prevention to countitem/countitem2skotlex1-0/+1
- 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-0/+2
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-2/+2
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-02-21Applied a consistent look to all header files (copyright, ifdefs)ultramage1-2/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9891 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-02-11Fixed @loadnpc not updating the script_event[] arrayultramage1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9850 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-29- Corrected the homunculus deletion functions so that the homunculus is ↵skotlex1-0/+1
deleted together with the character. - Added npc_check_areanpc so that Wand of Hermod will correctly check for nearby warps. - Emergency avoid now stacks with other speed boost statuses - Item skills and skills that bring up a menu now are cleared on death. - Minor cleanings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9742 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-05- Massive EOL normalization & 'svn:eol-style native' flag setting for all ↵FlavioJS1-90/+90
txt/conf/h/c files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9410 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-10-05- Added function npc_unload_duplicates(), it unloads all npcs that are a ↵skotlex1-0/+1
duplicate of the passed one. For use with @unloadnpc to prevent crashes when you unload the npc that has duplicates. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8939 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-09-05- Corrected SC_INTRAVISION not starting.skotlex1-2/+0
- Small cleanups (line terminators, indenting) - Fixed crash when attempting to read a Label as a string on a script (thanks to End of Exam) - Fixed possible crash when changing a chat-room's owner (thanks to End of Exam) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8639 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-07-27- Changed npc_click declaration to receive an npc structure rather than a ↵skotlex1-1/+1
generic block-list one. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7925 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-12- Made guild member exp an unsigned int.skotlex1-2/+3
- Modified npc_click to receive the bl that was clicked directly. Also cleaned it up so it isn't as easy to crash the server with invalid ids <.< - Moved npc_checknear to npc_checknear2 and added npc_checknear. The near version receives a bl, checks it's validity, and returns a TBL_NPC object, near2 does the same but doesn't checks for type NPC. The first returns a pointer, the second returns 1 on fail, 0 success. - Also uncommented various npc_checknear calls in the code, who's idea was to comment them out so you could exploit npcs from afar with custom packets? - Added overflow checks for bonus settings mdef_rate/def_rate. - Added missing update of INT after a buf. - Small cleanup of how SC_BLEEDING works. - Fixed party_foreach_samemap invoking the function on the CASTER instead of on the party members. - Added clif_parse_ActionRequest_sub to handle player commands, is used from npc_click or any other function that needs to "re-route" a player's request. - Modified clif_parse_NpcClicked to handle the different situations with different bl-objects (attack on players/mobs, click on npcs or mobs with npc attached) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7103 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-07- Added config setting mob_npc_warp, when set to yes, enables mobs to be ↵skotlex1-0/+1
warped between maps when stepping on a npc-warp. - Added monster_ai setting &64, when enabled makes a mob run to any nearby npc-warp when their current target has switched maps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7039 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-31[Moved]: Lance1-0/+2
fake_npc from map.h to npc.h git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6879 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-05-05- Added a npc-script-event cache to avoid looking up event-scripts every ↵skotlex1-0/+13
time they need to be executed. Events cached are all those defined in script_config. - Since the cache holds direct pointers to the npcs/events, do NOT unload the related NPCs or you'll get dangling pointers. However, @reloadscript will work fine. - Set the etc_log to on to see a summary of npcs/events loaded for script execution on startup. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6494 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-20- Added support for n to specify minutes to @charban. skotlex1-1/+1
- Fixed a logic typo on the way dummy_npc_id was defined. - Added state.trading to specify when a trading has started. Now you should be able to walk around until the trade is either rejected or started. - Armor defense is no longer reduced by the amount of characters targetting you. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6192 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18* Shinomori's method (kinda) of remote script execution with interaction.Lance1-0/+2
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6151 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16- Fixed mysql ping setting being in minutes rather than hours.skotlex1-1/+0
- Removed npc_event_sub from npc.h and moved it to npc.c - Cleaned up #warp to prevent spitting non-walkable tile warnings. - Changed the meaning of msg_athena 2, it is now "invalid target cell, randomizing". git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6114 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16* Sending fake npc for inputs and menus for NPC without map coordinates.Lance1-1/+1
* Fixed npc.h compiler warnings. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6112 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-16* Experimental npc_event_doall_sub with queue and npc_id allocation when needed.Lance1-0/+1
* Added warnings to npc_scriptcont for easier debugging. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6106 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-08- Fixed @movenpcskotlex1-1/+1
- Cleaned up and improved the lootsearch routine to pick nearest item. - Added INVISIBLE_CLASS to the list of classes supported by npc_get_viewdata - Fixed trying to set the view_data for npcs who are located on a map, but have no visual data. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5959 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-01- Added structure view_data to handle sprite information for all characters ↵skotlex1-3/+4
(equipment, weapons, hair, dyes, etc). Unified a bunch of clif functions now that you only need to handle the view_data (so instead of clif_spawn[pc/mob/npc/pet] you just have clif_spawn) - Fixed the clif_change_class packet (it should check for non players classes, not a class above MAX_PC_CLASS), it fixes morphing enemies. - Rewrote the way cloth dye packets are resent to optimize bandwidth usage. - Fixed the npc_item_flag thing (enable_items/disable_items script command) - Rewrote the disguise implementation to be bandwidth friendly. - Modified the hide options to change your class to INVISIBLE_CLASS, since such classes don't even get their view packets sent around. - Rewrote several clif functions to adapt to the new view_data class; - Added class 139 to npcdb_checkid which was required by some npcs in the swordman quest? o.O git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5833 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-03-22- Merged the unit_data structure from jA for handling unit-related data ↵skotlex1-3/+1
(attack times, walking, auto-attack timers, skill related data) - Modified unit_skillcastcancel to receive flag&2, which stands for "cancel casting only if current skill is cancellable" - Battle config options changed from yes/no to BL_TYPE settings: skillrange_by_distance, skill_noreiteration, skill_nofootset, gvg_traps_target_all, skill_log, attack_direction_change, auto_counter_type - Clif.c will disconnect sessions that send an unknown command packet above 0x30000 instead of just ignoring it. - Cleaned up/rewrite of the pet ai, same for pet_calc_pos - Implemented use of mob variable attacked_players as it is used on jA - Cleaned up error reporting during mob-skill loading to be less spamy with non-loaded mobs. - Corrected water_height reading. I forgot to give credits to LittleWolf for providing the water-reading function :X git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5707 54d463be-8e91-2dee-dedb-b68131a5f0ec