summaryrefslogtreecommitdiff
path: root/src/game-server/item.h
AgeCommit message (Collapse)AuthorFilesLines
2012-03-03Use callbacks for items, monsters and status effectsThorbjørn Lindeijer1-9/+22
Previously, global function names were defined in the respective XML definitions of items, monsters and status effects. This was reasonable when they all had the same state, but now they're sharing the single global Lua state. Now the Lua API provides access to the ItemClass, MonsterClass and StatusEffect instances, on which callbacks for both standard and custom events can be explicitly set. Reviewed-by: Erik Schilling
2012-03-02Merged all the different Lua states into oneThorbjørn Lindeijer1-5/+3
No more Lua state for each status effect, monster, item effect or map. All scripts are loaded into the same state. This should be more efficient overall and make it easier to implement dynamic reloading of the scripts in the future. Now, this introduces the problem of name collisions between different Lua scripts. For now this is solved by using more specific function names, like 'tick_plague' and 'tick_jump' rather than just 'tick'. The plan is however to get rid of these globals, and register these callbacks from the script, so that they can be local functions without the danger of colliding with other scripts. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira
2011-08-19Used the client base to make a final bugfix on the server code.Yohann Ferreira1-11/+14
Made the server handle only one slot type requirement since it's irrelevant to have more anyway. Plus, it simplifies the code for both equipping/unequipping. I also added a dagger to show how equipping/unequipping is working.
2011-08-10Changed ItemEquipInfo to only be a pair of unsigned.Yohann Ferreira1-1/+1
Previously it was a list of pair ofunsigned int, used to get the equipment slot requirements. It didn't make sense as the ItemEquipsInfo was already a list of it. So you had to manage with a list of list and that ended up being irrelevant to the need. I had to disable the equip function to permit compilation. This will be fixed in my next commit.
2011-07-27Small random code format cleanups, and documentation fixes.Yohann Ferreira1-0/+2
This doesn't change anything yet.
2011-04-19Implemented scriptable effects on item use and dispell.Yohann Ferreira1-8/+25
Reviewed-by: Thorbjorn.
2011-03-20Introduced separate functions for item database loadingThorbjørn Lindeijer1-5/+3
This splits the huge ItemManager::reload() into readEquipSlotsFile() and readItemsFile(), the latter of which is further split up into multiple functions for reading the different elements. Just to keep the amount of nesting down and increase the readability. Removes the need for huge eye-catching comment blocks. Reviewed-by: Freeyorp
2011-03-16Allowed item names instead of IDs in @commandsPhilipp Sehmisch1-0/+14
The @drop and @item commands can now accept an item name instead of an item ID. In addition the amount can be omitted to create a single item.
2010-12-08Fix many compiler warnings.Freeyorp1-7/+12
Reviewed-by: Bertram
2010-11-14Renamed .hpp files into .h for consistency.Yohann Ferreira1-0/+273
Also added an header to the autoattack.{h,cpp} files. Big but trivial fix.