Age | Commit message (Collapse) | Author | Files | Lines |
|
This removes support for skills. The plan is to allow to implement the skills
as they were implemented before via attributes. This adds a lot more
flexibility to the server creators while also removing the confusion about
skills and attributes.
So this change does:
- Remove the skillmanager with all its calls, the skill xml file, etc
- Move exp giving to the script engine:
--> Allows to implement the old behaviour (and more) in the scripts
- Remove the exp tag from the monster definition:
+ Since the server itself does not require it anymore it feels wrong to
require it for EVERY monster. TODO: Add a system to add properties to the
monsters/items.xml which allow defining things like the exp and allows to
read the value from the script engine.
+ Small drawback, but it should not be hard to implement this property
system.
- Drop the level networking and calculation.
+ level calculation will happen via the attribute system later but i would
prefer to do this in a seperate patch since this patch already got longer
than expected especially since this requires to make setting correction
points and available status points scriptable.
+ The level would be simply set as a attribute, the int number of it will be
the level, the remaining digits will be the % number till the next levelup.
- NOT remove any existing skill tables in the database update scripts.
+ There is no way to move them into the attribute table in a unified way
(there are too many different way they could have been used). So server
admins have to care about moving theirs skills to attributes themselves.
+ Keeping the old tables does not hurt for existing databases. So removing
does not give any advantage/is required anyway. The now obsolote info
about the EXP transaction is not removed for updated databases either.
(The update script basically only bumps the version number without doing
anything else.
- bump the network protocol version --> old clients won't be able to connect.
- bump the database version --> serveradmins need to update their db.
|
|
I did not adapt the scripts yet since we need some special handling for
the attributes which are required by the server directly. So you still
have to use the ids for those. I will change that later.
In the future I want to use the AttributeInfo class instead of the int
id everywhere possible. So I did a small start on that too.
|
|
|
|
It returns all monster classes in a id->monsterclass table.
|
|
As a side effect i had to remove the monster attack AI for now. I will
readd this as next thing.
|
|
Each ability can now define a cooldown that prevents the player from
using other abilities for a while. The time of this cooldown can be set
to any attribute. The modified value of the attribute is the value of
the cooldown in game ticks. The cooldown will be automatically started
if the ability has `autoconsume` set to true. Otherwise a script has to
call entity:cooldown_ability(ability).
|
|
|
|
This way the scripts can add or replace existing member functions, which
can be useful. As demonstration chr_money and chr_money_change are now
added as Entity.money and Entity.change_money.
Also fixed the banker to use ask_number instead of ask_integer (I had
decided to rename this and apparently forgot the banker).
Mantis-issue: 503
Reviewed-by: Ablu
|
|
|
|
|
|
Only moved a single script function to a member for now, will do others
in a separate commit.
|
|
I did not really care too much about staying consistent with the use of
static_casts to Actors since they are only temporary anyway until Actor
is a component too.
|
|
A CharacterData was created as a proxy class in order to allow using the
old serialization method.
|
|
Things done:
- Allowed to create new Attributes outside of the protected scope of Being
- Moved Monster to MonsterComponent
- Some minor cleanup in the Attribute setting code of monsters
|
|
|
|
Use lua_pushliteral and lua_pushlstring instead of lua_pushstring, which
avoids Lua having to determine the length of the string.
|
|
Should still work against Lua 5.1 as well.
|
|
New binds:
- Damage:
- id
- skill
- base
- delta
- cth
- element
- type
- truestrike
- range
- Attack:
- priority
- cooldown
- warmup
- global_cooldown
- damage
- on_attack
- MonsterClass:
- attacks
- ItemClass:
- attacks
|
|
|
|
It wasn't really adding anything since errors raised using luaL_error
are already logged anyway.
Reviewed-by: Erik Schilling
|
|
Reviewed-by: Ben Longbons
|
|
In preparation for using an entity/component system for the entities
in the game world, this name will be more recognizable and easier to
talk about.
Reviewed-by: Yohann Ferreira
|
|
- Made the current charge being saved.
- Added script binds:
- chr_set_special_recharge_speed
- chr_get_special_recharge_speed
- chr_set_special_mana
- chr_get_special_mana
- get_special_info
- Added special info lua class. Functions:
- name
- needed_mana
- rechargeable
- on_use
- on_recharged
- category
Further the engine no longer sets charge to 0 after using of specials
this allows more flexbilillity (like failing specials).
Changes on the xml database:
- recharge renamed to rechargeable (needed by client and server)
- needed - the needed mana to trigger a special (server only)
- rechargespeed - the defailt recharge speed in mana per tick (server only)
- target - the type of target (either being or point) (server and client)
I also made the lua engine pushing nil instead of a 0 light userdata when
the pointer was 0.
Database update needed.
Change is tested.
Mana-Mantis: #167, #156
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Rather than wrapping NPC functions up in coroutines in the Lua side, they
are now managed on the C++ side as "script threads", which are essentially
the same thing.
The main purpose is that the server can now know whether any of these long
running script interactions are still active, which will probably be useful
when adding the ability to reload scripts.
Reviewed-by: Erik Schilling
|
|
The new function 'checkCurrentMap' will raise an error when no current map has
been set, eliminating the need to do custom error handling all over the place.
This also fixes several functions that would otherwise have simply crashed
when there was no current map.
Also cleaned up some "empty string parameter" checks.
Reviewed-by: Erik Schilling
|
|
It's a bit embarrassing the way this has gotten out of hand. The error
checking was inconsistent, and in some cases wrong.
A host of new helper functions, starting with 'check' rather than 'get',
perform error handling on function arguments (they will not return when
encountering an error).
Reviewed-by: Erik Schilling
|
|
Item and monster classes could already be identified by either their id or
their name. Now the explicit values returned by 'get_item_class' and
'get_monster_class' can also be used as parameter.
In addition the above two getters learned to understand all three types of
parameter as well, rather than only supporting a name.
Reviewed-by: Erik Schilling
|
|
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
|
|
Based on a native Lua table with weak values, so that the user data objects
that are created can be garbage collected when no longer referenced.
Reviewed-by: Yohann Ferreira
|
|
Based on a templated helper class, MapObject references in Lua scripts are now
full user data objects. Using the '__index' member of their metatable, a
library is associated with it so that member functions can be called directly
on the object.
Reviewed-by: Yohann Ferreira
Reviewed-by: Erik Schilling
|
|
When creating a Lua table, it is possible to specify in advance how many
array elements and how many non-array elements this table will contain,
to avoid dynamic reallocations while filling the table. This wasn't used
optimally by the pushSTLContainer helper methods and some other cases.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
|
|
map_get_objects([string filter]): returns all object of the current map optionally filtered by type.
map_get_object_property(handle object, string key): returns the value of the property of the object.
map_get_object_bounds(handle object): returns x, y, width, height of an object.
map_get_object_name(handle object): returns name of an object.
map_get_object_type(handle object): returns type of an object.
Mantis-issue: 397
Reviewed-by: Thorbjørn Lindeijer
|
|
|
|
Also added an header to the autoattack.{h,cpp} files.
Big but trivial fix.
|