Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
Reviewed-by: bjorn.
|
|
This includes the quest reply, post reply, death notification and
remove notification.
Also, Script::Ref was changed from a typedef to a small class,
automating initialization and making the check for validness clearer.
Reviewed-by: Erik Schilling
|
|
Rather than relying on the availability of global functions with certain
predefined names, the Lua script now calls API functions to set which
function should be called on these global events.
This mechanism should make it easier to avoid name collisions in the global
namespace, which is important now that there is only a single script state.
For these global events this was not likely to become a problem, but this
solution can also be used for callbacks on specific item or monster types,
or even allow setting callbacks on certain instances.
Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
|
|
Mostly removed bulky copyright headers and fixed indentation and line length.
Reviewed-by: Yohann Ferreira
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
|
|
It's easier to just talk about world data and to modify it as a whole.
If there is really a need to separate it, a project can still choose to do
that (and in whatever suitable way). There is no need to enforce this
separation or to do it in our example.
Reviewed-by: Erik Schilling
|
|
Reviewed-by: Erik Schilling
|
|
Just defined an inline function to make talking to the player easier.
Would be nice when NPC scripts could look more like this by default.
Also indented with 4 spaces, which we do in C++ so why not Lua files
(the file had mixed 2 and 4 space indentation before).
|
|
This can now be done in attributes.xml through the
minimum and maximum attribute parameters.
I also changed the AttributeInfo struct as requested by bjorn.
Reviewed-by: Erik Schilling, Thorbjørn Lindeijer
|
|
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
|
|
The function will cause a global announcement.
If no sender ist set "Server" will be used.
Reviewed-by: Bjorn.
|
|
Those will make the scripters able to get a full view
of the current player's possessions. Use with care.
+ Fixes following Ablu's review.
Resolves: Mana-Mantis #207.
Reviewed-by: Ablu
|
|
the function can now count in the inventory
and/or the player's equipment.
I also fixed the script function and added a use case
in the example map.
+ Fixes after Ablu's review.
+ 2nd fix after Ablu's review: Fix the inventory remove behaviour.
Resolves: Mana-Mantis #288
Reviewed-by: Ablu
|
|
Reviewed-by: o11c, bjorn, Bertram.
|
|
Reviewed-by: Bertram.
|
|
Reviewed-by: o11c.
|
|
Reviewed-by: Thorbjorn Lindeijer
|
|
These scripts could trivially share one script state, since the methods
called on them from the server are not overlapping. This does leave them
open to access each other's global variables, but that's the problem
with global variables.
The one remaining global script file name is now configurable, so that
it may also be set to a script in a different scripting language. The
two related script options are:
script_mainFile (default: scripts/main.lua)
script_defaultEngine (default: lua) - renamed from defaultScriptEngine
Reviewed-by: jurkan
Reviewed-by: Yohann Ferreira
|
|
Added @permissions <character> which lists the permissions of a player.
Made @givepermission giving feedback on success.
Reviewed-by: Thorbjørn Lindeijer.
|
|
Conflicts:
src/game-server/accountconnection.cpp
|
|
At the moment it is the responsibility of the script to make sure any
references to beings passed into script functions are valid.
This means you can't schedule delayed scripts like the one making
maggots say 'Roaaarrrr!!!', since the being might have been removed
before the script gets executed. In the case of this bug the maggots are
removed by some script code testing 'mana.monster_remove'.
We should of course fix the way actor handles are used in Lua so that
scripts can't end up crashing the server.
Mantis-issue: 384
Reviewed-by: Yohann Ferreira
|
|
I also added a link to the skillmanager object in its header
file. This will later be used to get info from elsewhere than
the server main loop.
|
|
The file is now setting the correct attack for the given weapons.
I also updated the auto attack parameter to correspond the ones
needed in the code.
|
|
|
|
Add chatcommand @getpos <character> which return the mapid and location of the character.
Part of: Mana-Mantis: #385.
Reviewed-by: Bertram.
|
|
|
|
Add chatcommand @getpos <character> which return the mapid and location of the character.
Part of: Mana-Mantis: #385.
|
|
|
|
|
|
|
|
|
|
working and expected by the server to be known by the client.
Note: I would like to get rid of specials.xml on the client side and make
the gameserver provide all information relevant for the players character
at runtime to allow for proceduarally generated specials.
|
|
equipment-fix
Conflicts:
example/serverdata/scripts/maps/desert.lua
|
|
|
|
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.
|
|
You now can change the anger of a monster to a being using
mana.monster_change_anger(monster, being, anger)
Resolves: Mana-Mantis #366.
|
|
You now can change the anger of a monster to a being using
mana.monster_change_anger(monster, being, anger)
Resolves: Mana-Mantis #366.
|
|
git://gitorious.org/~bertram/mana/manaserv-equipment-fix into equipment-fix
Conflicts:
src/common/manaserv_protocol.h
|
|
Resolves: Mana-Mantis #318.
Reviewed-by: Bertram.
|
|
|
|
You can now use either the name or the id of the item in the LUA
functions chr_inv_change, monster_create, item_drop.
Part of: Mana-Mantis #318.
Reviewed-by: Bertram.
|
|
|
|
I also changed the chatmessage function to chat_message
to follow the coding standard.
|
|
mana.monster_remove(monster) can now be used to remove a monster
from a map.
Resolves: Mana-Mantis #352.
Reviewed-by: Bertram.
|
|
|
|
You can now call mana.get_distance(being1, being2) or
mana.get_distance(x1, y1, x2, y2) for calculating distances.
Reviewed-by: Jaxad0127, Bertram.
Resolves: Mana-Mantis #370.
|
|
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.
|
|
Effects aren't applied only on beings. Hence the former tag
name was irrelevant.
|
|
In fact, the client never prefixed that file. Hence, the server
doesn't have to.
|