summaryrefslogtreecommitdiff
path: root/src/map/npc.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-04Implementation of Item Options System.Smokexyz1-0/+15
Allows the infusing of equipments with bonus item options. This feature is constrained to clients of packet versions greater than or equal to `20150226`. Item Options and their effects are defined server-side in `db/item_options.conf` and client side in `data/luafiles514/lua files/datainfo/addrandomoptionnametable.lub` The ID of the option must tally with the correct index of the description provided in the client side lua file to avoid bugs. IT_OPT_* keys and MAX_ITEM_OPTIONS macro are also exported from the source as constants. An additional flag `disable_options` has been added to sql, and as `DisableOptions: true/false (boolean, defaults to false !!for equipments only!!)` to item_db.conf files. Script commands documentation is also included. SQL file updates are included. Credits: [Smokexyz](https://github.com/Smokexyz) Style and Script Fixes by [Asheraf](https://github.com/Asheraf) Initial design Idea by [secretdataz](https://github.com/secretdataz)
2016-12-03Remove the platform-dependent variables from struct status_dataHaru1-3/+3
`struct status_data::class_` was platform dependent since c30bb75ec50624429bff7b4106db4be0fda366d6 in order to silence some compile warnings (uint32 on 64 bit builds and uint16 on 32 bit builds). It's now been changed to the correct type, int32, on all platforms. Since the change has potential to silently break third party code, the variable was renamed to `class`. Signed-off-by: Haru <haru@dotalux.com>
2016-10-28Fixed copyright year for 2016Lemongrass31101-1/+1
2016-09-18Removed special handling of "clear" in npc->addsrcfile()Haru1-10/+8
- Use npc->clearsrcfile() instead. Signed-off-by: Haru <haru@dotalux.com>
2016-09-18Removed special handling of "all" by npc->delsrcfile()Haru1-12/+9
- Use npc->clearsrcfile() instead. Signed-off-by: Haru <haru@dotalux.com>
2016-09-11Allow sell items to market shop.Andrei Karas1-1/+1
2016-09-10Adds official behavior when selling to NPCs. Fixes issue #1214KirieZ1-1/+7
2016-06-25Moved translations template generator to a pluginHaru1-6/+0
Signed-off-by: Haru <haru@dotalux.com>
2016-06-25Replaced script_code::script_buf with a VECTORHaru1-1/+1
- Fixes various signed/unsigned comparisons. Signed-off-by: Haru <haru@dotalux.com>
2016-06-18Move npc static variables into npc interface.Andrei Karas1-47/+47
2016-04-27Fix unit_data unitialisation.Andrei Karas1-8/+2
Introduce method unit->init_ud.
2016-04-04Add missing checks into npc.Andrei Karas1-13/+143
2016-03-20Dropped typedef from DBMapHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedef from DBIteratorHaru1-6/+6
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Dropped typedefs from union DBKey and struct DBDataHaru1-8/+8
Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Removed unnecessary typedefs from sql.hHaru1-2/+4
- Sql -> struct Sql - SqlStmt -> struct SqlStmt - SqlDataType -> enum SqlDataType This is expected to improve compile time, by removing #include cycles (and forward declaring instead) Signed-off-by: Haru <haru@dotalux.com>
2016-03-20Added const qualifier to the value argument of script->setd_subHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Edited npc->selllist() to use the new struct itemlistHaru1-27/+31
- The npc-side code no longer depends on the client data layout. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Edited npc->buylist() to use the new struct itemlistHaru1-34/+38
- The npc-side code no longer depends on the client data layout. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Edited npc->market_buylist() to use the new struct itemlistHaru1-30/+28
- The npc-side code no longer depends on the client data layout. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Edited npc->cashshop_buylist() to use the new struct itemlistHaru1-22/+20
- The npc-side code no longer depends on the client packet data layout. Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Added const qualifier to various variable/argument pointersHaru1-1/+3
- This is necessary for compatibility with a const RP2PTR/RFIFO2PTR Signed-off-by: Haru <haru@dotalux.com>
2016-02-24Fixed two minor typos in NPC-related error/warning messagesHaru1-2/+2
Signed-off-by: Haru <haru@dotalux.com>
2016-02-19Fix all known warnings from compiler flags -Wformat*Andrei Karas1-7/+7
Add all missing -Wformat flags into configure.
2016-02-05Merge pull request #993 from HerculesWS/mobdb2sqlAndrei Karas1-15/+15
Mob DB support for the db2sql plugin
2016-01-29Replaced several floating-point operations with integer operationsHaru1-15/+15
This fixes several rounding errors happening in various places (i.e. the base exp for HORONG being calculated as 819 instead of 820 when the server rates are set to 1x) Signed-off-by: Haru <haru@dotalux.com>
2016-01-21Remove unused PCRE_SUPPORT define.Andrei Karas1-2/+0
2016-01-13Converted const.txt to libconfig formatHaru1-1/+1
- This is necessary for upcoming improvements Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced the remaining explicit casts with BL_CAST/BL_UCASTHaru1-11/+12
Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced some explicit casts with BL_UCASTHaru1-5/+4
- Replaced safe casts (bl type already checked) Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced some map->id2sd calls with the proper map->id2XX functionHaru1-12/+13
- Also added new map->id2XX convenience functions for the other bl types. Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced some explicit casts with BL_UCAST/BL_UCCASTHaru1-7/+20
- Replaced casts in foreach callbacks. - Added assertions and nullpo checks where applicable. Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced some explicit casts with BL_UCAST/BL_UCCASTHaru1-5/+4
- Replaced the map-iterator related casts. Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Change all TBL_NPC to struct npc_data as per style guidelineshemagx1-3/+3
Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Change all TBL_PC to struct map_session_data as per style guidelineshemagx1-4/+3
Signed-off-by: Haru <haru@dotalux.com>
2015-12-31Extended the numeric view ID deprecation to '-1' (FAKE_NPC)Haru1-2/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-12-31Replaced leftover -1 view IDs with FAKE_NPCHaru1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-12-25Implemented NoViewIDDastgir1-0/+2
(http://herc.ws/board/topic/10020-official-mapflag-to-disable-viewid/) Closes #926 as merged Signed-off-by: Haru <haru@dotalux.com>
2015-12-21Fix Client stuck if npc secure time reached and no actual dialog presented ↵hemagx1-1/+6
to client. Fix dialog being cleared if npc secure time reached and dialog exist Fixes #916
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Fix Dialog being cleaned after timeout on secure npc timeout enabled.hemagx1-1/+0
Closes #916
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_unknown_objectHaru1-1/+18
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_mobHaru1-1/+19
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_functionHaru1-3/+26
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_duplicateHaru1-8/+37
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_scriptHaru1-6/+32
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_shopHaru1-5/+18
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_warpHaru1-2/+19
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added const qualifier to the w1~w4 arguments of npc_parse_mapflagHaru1-7/+35
- This is necessary before merging #960 Signed-off-by: Haru <haru@dotalux.com>
2015-12-06Fixed a validation issue in the NPC Sell ListHaru1-5/+13
Signed-off-by: Haru <haru@dotalux.com>