Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
It wasn't really adding anything since errors raised using luaL_error
are already logged anyway.
Reviewed-by: Erik Schilling
|
|
Conflicts:
src/game-server/character.h
|
|
read them
The difference to the old chr_get_quest bind is that this allows querying quest
vars from non npc functions as well.
Change is tested.
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Change is tested.
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Previously it only used the rectangle iterator which in fact iterated over the
beings in the map zones and returned often way higher number of beings compared
to the actual rectangle.
Change is tested.
Reviewed-by: Bjorn.
|
|
Previously it only used the rectangle iterator which in fact iterated over the
beings in the map zones and returned often way higher number of beings compared
to the actual rectangle.
Change is tested.
Reviewed-by: Bjorn.
|
|
Previously each map had its own scope. They got merged now but the atinit
function was forgotten to adapt.
|
|
Also unsetted maps after execution of scripts to make finding this mistakes easier.
Reviewed-by: bjorn.
|
|
Also unsetted maps after execution of scripts to make finding this mistakes easier.
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
Reviewed-by: bjorn.
|
|
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
|
|
I forgot to remove this during my special cleanup
Reviewed-by: bjorn.
|
|
This is intended to be used only when the string length is known. The
client was deriving the length from the remaining amount of data in the
message, but that doesn't work in the new 'debug mode' of the protocol.
Reviewed-by: Ben Longbons
|
|
Reviewed-by: Ben Longbons
|
|
Reviewed-by: bjorn
|
|
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.
|
|
Reviewed-by: bjorn.
|
|
For a non-empty vectors that did not contain the element to remove, the
loop would go on forever because a size_t can't become smaller than 0.
Fixed by simply iterating forwards.
|
|
Another step towards scriptable @commands.
Reviewed-by: bjorn.
|
|
Another step for being able to make @commands scriptable
Reviewed-by: bjorn.
|
|
Step to be able to handle chatcommands by scripts.
Reviewed-by: bjorn.
|
|
TODO: Inform client about this change.
Reviewed-by: bjorn.
|
|
Forgot to do this in the previous commit.
|
|
Scripts mostly execute the Mana script API, and it seems like just
unnecessary verbosity to refer to the 'mana' table all the time. This table
no longer exists now.
Reviewed-by: Erik Schilling
|
|
When creating an NPC, you now provide its optional talk and update functions
directly rather than them being stored in a table on the Lua side and then
called in response to a global callback.
Also fixed an issue with a missing gender parameter to the delayed NPC
creation callback used by NPCs defined on the map (found by Erik while
reviewing this patch).
Reviewed-by: Erik Schilling
|
|
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
|
|
This was meant to be amended to the previous commit...
|
|
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
|
|
mana.map_get_pvp() now returns one of the constants in libmana-constants.lua
Reviewed-by: Bertram.
|
|
This allows the script to let the character perform a scripted attack but
the character still gets xp and killed monsters give drops.
You can now call:
mana.being_damage(target, dmg, dmg_delta, accurancy, type, element, source,
skill)
While on it I also added checks to the being_damage function.
Reviewed-by: bjorn, Bertram.
|
|
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
|
|
The ScriptAction of the TriggerArea (which can be created by
mana.trigger_create) was still using a named global function for its
callback. Now it also uses a reference to a script function.
Since it was the last occurrence of a call to a global script function,
I've also removed the Script::prepare(std::string) overload.
Reviewed-by: Erik Schilling
Mantis-issue: 299
|
|
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
|
|
Reviewed-by: bjorn.
|