Age | Commit message (Collapse) | Author | Files | Lines |
|
As a side effect i had to remove the monster attack AI for now. I will
readd this as next thing.
|
|
Mana-mantis: #506.
|
|
This allows the server to compile with c++0x (and enables it).
This also includes some coding style / readabillity fixes.
|
|
Same thing, but shorter.
|
|
During the implementation bjorn and I agreed to limit the number of attacks that
can be used in the same tick to one. This makes a lot of stuff easier and the
client cannot display two frames at the same time
Things done:
- Implemented setting of attacks when equipping/unequipping items
- Single place where the xml attack node is parsed
- Finished attack logic
- Unified the attack handling of monsters and characters
- Added a global cooldown after attack use
(not only for next use of same attack)
- Removed the temponary attributes for the monster attack values
- Priorities for all attacks
- Rewrote the attack core:
- Attacks now have this attributes:
- warmup -> time a attack needs after starting it to actually deal the damage
- cooldown -> time a attack needs after dealing damage before another attack
can be used
- reuse -> time before the same attack can be used again
- If no attack is performed at the moment the following is done:
- make a list with all ready attacks
- check for attack that has the necessarily range and highest priority
- start this attack (inform client about it)
- when warmup is finished -> trigger damage
- when cooldown is finished -> allow to use other (or the same if reusetimer
allows) attacks
TODO:
- sync client with this to allow better timed animations
|
|
|
|
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
|
|
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
|
|
Conflicts:
src/game-server/character.cpp
src/scripting/lua.cpp
|
|
Reviewed-by: Bjorn, Bertram.
|
|
|
|
|
|
When I introduced NameMap it was only used with pointers, but now it is
also used with std::string so it probably makes sense to keep a default-
constructed value around so that a reference can be returned rather than
a copy.
NameMap::find was renamed to NameMap::value to make it more clear that
it doesn't return an iterator, like std::map::find.
Reviewed-by: Yohann Ferreira
Reviewed-by: Ben Longbons
|
|
Conflicts:
src/game-server/inventory.cpp
src/game-server/inventory.h
src/game-server/item.h
src/game-server/main-game.cpp
src/game-server/skillmanager.cpp
src/utils/point.h
|
|
and item managers.
ack-by: o11c.
note: The managers still need to auto deinit when already loaded.
This will be done in another trivial commit.
|
|
|
|
an arbitrary number of layers. (up to 255).
|
|
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.
|
|
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.
|
|
|
|
|
|
Reviewed-by: Thorbjorn.
|
|
By default XML::Document will use the ResourceManager to resolve the
file name you pass to it. There is no point in disabling that
functionality only to resolve it manually.
Reviewed-by: Jared Adams
|
|
Introduced a template class NameMap, which provides a nice API for
mapping any custom types by their name.
This change also makes any duplicate item or monster definitions be
complete ignored, rather than being merged into the first definition.
Reviewed-by: Philipp Sehmisch
Reviewed-by: Yohann Ferreira
|
|
|
|
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
|
|
Easier to understand than a std::pair<unsigned int, unsigned int>, or
functions like getTagFromInfo(unsigned int, unsigned int), which does
not make clear what that "info" actually is.
Now it's simply getTag(const ModifierLocation &location), documenting
itself and also allowing the name to be shorter.
Reviewed-by: Freeyorp
|
|
Just seems a bit more organized to me.
|
|
A bunch of variables that were continuously requested from the
configuration are now members of the AccountHandler.
Reviewed-by: Freeyorp
|
|
* Rely on the fact that a std::string is empty by default
* Use std::string::empty() rather than comparing to ""
* Construct with std::string() rather than from ""
Reviewed-by: Bertram
|
|
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.
|
|
Also added an header to the autoattack.{h,cpp} files.
Big but trivial fix.
|
|
Also fixed a memleak when loading an invalid monster attack.
Resolves: Mana-Mantis #215.
Reviewed-by: Thorbjorn.
|
|
|
|
Attribute system:
Structure is no longer completely hardcoded. Attributes and structure is
defined by new xml file (defaulting to stats.xml)
Structure defines non-base modifications to an attribute, to be used by
modifiers from items, effects, etc.
Calculating the base value for core attributes is still done in C++ (and for
such fundamental elements the only reason I can think of to do it any other
way is perhaps being able to quickly change scripts without a compile could be
useful for testing, but such things are a low priority anyway)
Item structure:
Modifiers are now through triggers rather than single events. This also
removes hardcoded types - an item could be both able to be equipped and be
able to be activated.
Item activation no longer consumes by default, this must be specified by the
property <consumes /> inside the trigger.
Currently only attribute modifications, autoattacks, and consumes are defined
as effects, but stubs for others do exist. Autoattacks are currently
non-functional, and this should be rectified with some urgency.
Auto Attacks:
AutoAttacks are now separate entities, though not fully complete, nor fully
integrated with all beings yet. Integration with the Character class is
urgent, integration with other Being children less so.
When fully integrated this will allow for multiple autoattacks, through
equipping multiple items with this as an equip effect or even through other
means if needed.
Equipment structure:
As ItemClass types are no longer hardcoded, so too are equip types. An item
have multiple ways to be equipped across multiple equipment slots with any
number in each slot. Character maximums are global but configurable.
Miscellaneous:
Speed, money, and weight are now attributes.
Some managers have been changed into classes such that their associated
classes can have them as friends, to avoid (ab)use of public accessors.
The serialise procedure should also be set as a friend of Character (both in
the account- and game- server) as well; having public accessors returning
iterators is simply ridiculous.
Some start for such cleanups have been made, but this is not the primary focus
here. Significant work will need to be done before this is resolved
completely, but the start is there.
BuySell::registerPlayerItems() has been completely disabled temporarily. The
previous function iterated through equipment, yet in the context I think it is
intended to fill items? I have been unable to update this function to fit the
modifications made to the Inventory/Equipment/Possessions, as I am unsure what
exactly what it should be doing.
ItemClass::mSpriteId was previously unused, so had been removed, but I
notice that it was used when transmitting equipment to nearby clients.
Experimentation showed that this value was never set to anything other than
0, and so has been left out of the ItemManager rewrite.
I am not entirely sure what is happening here, but it should be worth looking
into at a later time, as I am not sure how equipment appearences would be sent
otherwise.
|
|
Makes the code a little nicer.
|
|
libxml2 should be able to handle files with a BOM fine.
Reviewed-by: Bertram
|
|
Reviewed-by: Thorbjorn, Jaxad0127
|
|
Instead of loading data from a 'data' directory in the current working
directory, the server now uses clientDataPath and serverDataPath as
specified in the configuration. This removes the need to set up symbolic
links in order to merge these two types of data.
The default values point to example/clientdata and example/serverdata,
where a minimal example world can be developed to make setting up an
initial server quick and easy.
The XML::Document convenience class was copied over from the client.
Also, the ResourceManager is now shared between both servers, since the
account client is reading items.xml.
Reviewed-by: Jared Adams
|
|
Reviewed by: Jaxad0127
|
|
|
|
|
|
Also updated the headers to refer to the GPL by URL instead of
suggesting to contact the FSF by snail mail, as per the latest
GPL usage instructions.
|
|
Removed pointless void in method parameter lists, fixed methods and
variables that started with upper case, removed pointless 'const' for
stuff passed by value, made some getters const, etc.
|
|
still hardcoded). performAttack now takes a target and a range argument instead of determining the target with accumulate&fire
|
|
It should be noted that Jax still needs to update the client
Level calulation seems broken now too
|
|
Same as for the client.
|
|
|
|
|
|
The provided CreateTable.sql scripts store their versions inline of a database table. The account server checks this version number with its known
compatible version. If the numbers don't match, the account server raises an error and shuts down.
|