summaryrefslogtreecommitdiff
path: root/src/game-server
AgeCommit message (Collapse)AuthorFilesLines
2011-09-01Prevented char from picking up items when inventory is full.Erik Schilling1-9/+14
Resolves: Mana-Mantis: #379.
2011-08-30As requested, changed the trigger 'existence' to 'in-inventory'.Yohann Ferreira1-2/+2
2011-08-30Avoid crashing the game server when the last argument is quoted.Yohann Ferreira1-1/+9
Resolves: Mana-Mantis #386
2011-08-26Fixed mem leak on the item and monster manager unloading processYohann Ferreira3-3/+11
2011-08-26Rewrote the skill manager the same way as the item manager.Yohann Ferreira3-131/+169
This will permit better handling of both skills names and id. This is needed to start reworking on the auto-attack system.
2011-08-26Added a bit more precision on the conditions used in the ↵Yohann Ferreira2-2/+6
TriggerArea::update() function.
2011-08-26Fixed the trigger area declared within map files.Yohann Ferreira1-1/+5
The bug was pretty generic, as the contains() method of the Rectangle class wasn't checking against left and top sides according to the client view point. Resolves: Mana-Mantis #317.
2011-08-19Changed the sprite layer protocol to supportYohann Ferreira4-57/+64
an arbitrary number of layers. (up to 255).
2011-08-19Used the client base to make a final bugfix on the server code.Yohann Ferreira4-132/+147
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-18Change the unequip function to make use of the item instance id.Yohann Ferreira2-16/+14
It will make the client capable to tell which item is to be unequipped when there are several item equipped within a slot type, for instance. The client has now yet to be upgraded to follow the new protocol.
2011-08-18Fixed a crash when dealing with unknown equipped items.Yohann Ferreira1-1/+1
2011-08-11Basically redid equip and unequip functions().Yohann Ferreira2-154/+262
I made the system handle the fact that equipment item are completely unlinked to the inventory items. Equip items now have a unique itemInstance number permitting to equip the same item type multiple time when the slot capacity is wide enough to do so. I also prepared the functions to welcome in the near tests against scripted equipment. The equip process is known to be working server-side but the unequip process has yet to be reviewed, even if implemented.
2011-08-10Changed ItemEquipInfo to only be a pair of unsigned.Yohann Ferreira3-14/+12
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-08-10Fixed getting slot id per name.Yohann Ferreira2-6/+20
2011-08-04Change the changeEquipment() function nameYohann Ferreira2-7/+7
to something more meaningful.
2011-07-27Reworked the way equip slot info are loaded in a more logical way.Yohann Ferreira4-70/+83
2011-07-27Reviewed the removeFromSlot() function, fixing the unequip triggerYohann Ferreira1-5/+16
2011-07-27Fixed and completed the move() function.Yohann Ferreira2-22/+70
Moving and splitting items in the inventory window should be much more responsive now.
2011-07-27Reviewed the Inventory::remove() function.Yohann Ferreira2-9/+17
The unecessary equipment check was already removed, but the now useless force parameter is now also removed.
2011-07-27Reviewed the Inventory::insertion function.Yohann Ferreira1-5/+16
2011-07-27Finished the inventory check, by dropping itemsYohann Ferreira1-3/+19
in oversized inventories.
2011-07-27First revision of the Inventory::initialize() code.Yohann Ferreira1-26/+38
The inventory part is done. The equipment one will only handle equipment triggers for now.
2011-07-27Forgot to update the gamehandler.cpp file.Yohann Ferreira1-8/+8
2011-07-27Changed the protocol a bit to use int16 instead of 8.Yohann Ferreira1-4/+4
This is in preparation of fixes for issues: #373, and 379. Equip and inventory related packets are the only ones changed.
2011-07-27Begun Applying the new equipment slot handling design.Yohann Ferreira3-46/+18
now, the equipment slots are independant from the inventory slots according to the inventory and equipment data. This will permit to avoid checking the equipment each time one touches the inventory and vice versa, and make the former delayed mode useless. Also, note that equipped items will be removed from inventory and readded once unequipped. The design will permit the following, even if not implemented yet: - To make equipment items stackable again, if wanted. - Have more than one item with the same id equipped on different slots using the itemInstance field. Note: I didn't add the database structure updates yet, to see whether other changes may later go along with those.
2011-07-27Removed the inventory delay mode for now.Yohann Ferreira3-278/+85
I said I wouldn't do it, but I change my mind. Here is why: The delay mode is used in the trading code, and in the inventory code for lua only. In the lua part, the delay mode is useless as it is used only when the script is requesting removal of more items than owned. This is something that can't be handled well anyway, as for the script part, even when the character was still keeping its items. Plus, it's not actually an error, IMHO. In the trading code, it made sense. But the next commit will bring design changes making the inventory items and the equipment items not linked anymore. Hence, making it impossible to trade equipped items, for instance, which is a good thing IMHO. It will also remove the need of a delayed inventory mode in that case. The two cases where it is used will disappear, making it useless. Last but no least, the part watching for equipment changes in the commit() function is not something easy to debug without first having a proper and working base. (checking of two multimaps changes, for instance). We can add it back once the code has been fully debugged for the most skilled among us. And yes, I am sure of what I'm currently doing. For now the whole inventory and trading code is in need of review but it already was, anyway.
2011-07-27Small random code format cleanups, and documentation fixes.Yohann Ferreira4-78/+49
This doesn't change anything yet.
2011-06-24Fixed autoattacks basic handling.Yohann Ferreira4-15/+59
The server is now using the autoattacks system to perform damage based on the attack's timer. I also added a default bare knuckle attack when the character is unequipped. As a result, maggots can be killed again with bare hands now. Known issues left: This isn't tested against equipment changes for now, and the client isn't in sync with the attacks speed. Reviewed-by: Crush.
2011-06-17Changed the attack message to send the attack id.Yohann Ferreira3-6/+7
This is more precise than sending the attack type, that can be guessed by the client anyway when the type parameter will be added in the <attack> tag. This is the server part of Mana issue: #363. Reviewed-by: Bjorn.
2011-06-02Fixed crash when handling unequipThorbjørn Lindeijer1-5/+13
* The 'itp' parameter is no longer simply ignored (seems to be a small optimization in Inventory::remove) * Avoid incrementing an invalid iterator, fixing a crash (problem found by Stefan Dombrowski) * Use the right inventory index in the call to changeEquipment, which previously was using "it", which would be equal to "it_end" there. Reviewed-by: Stefan Dombrowski
2011-05-30Routing party invite through the map serverStefan Dombrowski2-0/+45
The player sends party invites to the game server. If the invitee is within the visual range of the inviter, the game server forwards the invite to the chat server. Reviewed-by: Bjorn, Jaxad0127
2011-05-26Allow monsters to drop multiple itemsStefan Dombrowski2-27/+12
Before at most one item was droped and the sum of all probablilites was limited to 100%. Also in the example data drops are changed to existing items.
2011-05-26Fixing negative being positionsStefan Dombrowski1-1/+4
Reviewed-by: Jaxad0127
2011-05-17Fixed an item dupe bugAngelo Castellani1-4/+15
Listed: http://bugs.manasource.org/view.php?id=324 Reviewed-by: Yohann Ferreira Reviewed-by: Jared Adams
2011-05-15Removed unused variableThorbjørn Lindeijer1-3/+1
2011-05-15Fixed compile with GCC 4.6Thorbjørn Lindeijer2-1/+2
* Include cstddef to be able to use size_t * Replace NULL with 0 since NULL doesn't happen to be defined in any included header file
2011-05-01Renamed the mana-status-effects.xml to status-effects.xmlYohann Ferreira1-1/+1
In fact, the client never prefixed that file. Hence, the server doesn't have to.
2011-05-01Changed the server to look for the skills.xml file.Yohann Ferreira1-1/+1
This, instead of the mana-skills.xml file, to follow latest client changes.
2011-04-27Added a simple crafting systemPhilipp Sehmisch2-0/+80
A client can craft something using the @craft command. The command needs a list of item names and amounts. The gameserver checks if the character has these items in the inventory and then passes the list together with the character handle to the lua script function on_craft in the script file scripts/crafting.lua. This function can then be used to evaluate if the list is a valid crafting combination and when this is the case take or give items. Implemented two example crafting scripts there, one which enforces exact item order and amount and one which doesn't. Both are disabled per default and one needs to be enabled by uncommenting a line. Also gave the player group permission to use the @craft command in permissions.xml and added two new items (wood and iron) required for the example crafting combination. Resolves: #333 Reviewed-by: bcs86, Bertram
2011-04-19Implemented scriptable effects on item use and dispell.Yohann Ferreira3-17/+87
Reviewed-by: Thorbjorn.
2011-04-18Made the server send the being position each 5 seconds.Yohann Ferreira1-3/+13
This will permit the client the make position resyncs when necessary, and make use of the MOVING_POSITION and DESTINATION where relevant. Reviewed-by: Thorbjorn.
2011-04-17Added of precised some info I found very useful while debugging.Yohann Ferreira2-8/+28
Reviewed-by: Jaxad0127.
2011-04-17Removed useless calls to updateDerivedAttributes().Yohann Ferreira2-2/+0
The setAttribute() already takes care of updating them. Reviewed-by: Jaxad0127.
2011-04-17Removed an unecessary call to attribute recalculation for monsters.Yohann Ferreira1-1/+0
The only need to call this function was to trigger derived attributes recalculation as the base attribute recalulation does nothung for monsters atm. And this is useless as setAttribute() already triggers derived attributes recalulation. Reviewed-by: Jaxad0127.
2011-04-17Fix beings raw speed calculation when obtaining the TPS speed.Yohann Ferreira1-1/+6
The bug made the monsters unable to move. Reviewed-by: Jaxad0127.
2011-04-16Set log verbosity earlier in game server to actually help debug.Yohann Ferreira1-6/+6
Before that, all the loading information were kept at info level. Trivial.
2011-04-15Fixed crash on first map updateThorbjørn Lindeijer2-0/+16
The crash happened when it was trying to move an NPC from its old zone to its new zone. The old zone was based on the old position, which was (0,0). That crashed since its zone didn't match its old position, but its new one. This fix makes sure to update the old position to be in sync with the zone, by resetting it after being inserted into the MapComposite. Reviewed-by: Yohann Ferreira
2011-04-10Initialize attribute base and cached modified valuesThorbjørn Lindeijer1-0/+2
Attributes that didn't get a value yet are not communicated from account to game server. This could leave some attributes with uninitialized (random) values, like the amount of gold or some uncalculated attack speed bonus. Defaulting the value to 0 seems to be appropriate for all current cases. When another default value should be used, it can be specified in attributes.xml and will be sent from the account server. Reviewed-by: Stefan Dombrowski
2011-04-04Fixing reading of drop rate from monsters.xmlStefan Dombrowski1-2/+2
The xml gives the drop rate as a floating point number. Also added 0.5 for correct rounding. (Without it 0.7% calculates to 69.) Reviewed-by: Jaxad0127
2011-04-03Changed SYNC_BUFFER_SIZE to unsigned to avoid compiler warningThorbjørn Lindeijer1-2/+5
It's being compared to an unsigned integer. Reported-by: Stefan Dombrowski