diff --git a/docs/defaultEvents/player/onPlayerSpellCast.md b/docs/defaultEvents/player/onPlayerSpellCast.md index eaf2c28..c39c5c0 100644 --- a/docs/defaultEvents/player/onPlayerSpellCast.md +++ b/docs/defaultEvents/player/onPlayerSpellCast.md @@ -11,6 +11,7 @@ Original: [onPlayerSpellCast](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0 * `dict` **kwargs**: * `int` **playerid**: the id of the player who casts the spell. * `str | null` **instance**: the item instance from Daedalus scripts. + * `int` **spellLevel**: the level of charged spell. ## Usage ```python diff --git a/docs/functions/player/getPlayerUID.md b/docs/functions/player/getPlayerUID.md new file mode 100644 index 0000000..992e536 --- /dev/null +++ b/docs/functions/player/getPlayerUID.md @@ -0,0 +1,2 @@ +#`function` getPlayerUID +::: g2o.functions.player.getPlayerUID \ No newline at end of file diff --git a/g2o/functions/player.py b/g2o/functions/player.py index cf8fa11..995471f 100644 --- a/g2o/functions/player.py +++ b/g2o/functions/player.py @@ -698,6 +698,22 @@ def getPlayerTalent(id : int, talentId : int) -> int: `int`: the current talent value for specific talent id. """ return sqg2o.getPlayerTalent(id, talentId) + +def getPlayerUID(id : int) -> str: + """ + This function will get the player pc unique identifier. + Original: [getPlayerUID](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/player/getPlayerUID/) + + ## Declaration + ```python + def getPlayerUID(id : int) -> str + ``` + ## Parameters + `int` **id**: the player id. + ## Returns + `str`: the player UID. + """ + return sqg2o.getPlayerUID(id) def getPlayerVirtualWorld(id : int) -> int: """ diff --git a/src/events/sqevents_player.cpp b/src/events/sqevents_player.cpp index 8f261fd..46ee2c1 100644 --- a/src/events/sqevents_player.cpp +++ b/src/events/sqevents_player.cpp @@ -284,12 +284,14 @@ SQInteger sq_onPlayerSpellCast(HSQUIRRELVM vm) { SQInteger playerid; const SQChar* instance; + SQInteger spellLevel; nonut::sqGetValue(vm, 2, &playerid); if (sq_gettype(vm, 3) != OT_NULL) nonut::sqGetValue(vm, 3, &instance); + nonut::sqGetValue(vm, 4, &spellLevel); - py::dict kwargs = py::dict("playerid"_a=playerid, "instance"_a=instance); + py::dict kwargs = py::dict("playerid"_a=playerid, "instance"_a=instance, "spellLevel"_a=spellLevel); callEvent("onPlayerSpellCast", kwargs); return 0; diff --git a/src/functions/pyfunctions.cpp b/src/functions/pyfunctions.cpp index 0986785..e650975 100644 --- a/src/functions/pyfunctions.cpp +++ b/src/functions/pyfunctions.cpp @@ -133,6 +133,7 @@ int py_getPlayerSkillWeapon(int id, int skillId) std::string py_getPlayerSpell(int id, int slotId) { return SERVERFUNC->getPlayerSpell(id, slotId); } int py_getPlayerStrength(int id) { return SERVERFUNC->getPlayerStrength(id); } int py_getPlayerTalent(int id, int talentId) { return SERVERFUNC->getPlayerTalent(id, talentId); } +std::string py_getPlayerUID(int id) { return SERVERFUNC->getPlayerUID(id); } int py_getPlayerVirtualWorld(int id) { return SERVERFUNC->getPlayerVirtualWorld(id); } py::dict py_getPlayerVisual(int id) { return SERVERFUNC->getPlayerVisual(id).data; } int py_getPlayerWeaponMode(int id) { return SERVERFUNC->getPlayerWeaponMode(id); } diff --git a/src/functions/pyfunctions.h b/src/functions/pyfunctions.h index 539d686..e2bfd8b 100644 --- a/src/functions/pyfunctions.h +++ b/src/functions/pyfunctions.h @@ -88,6 +88,7 @@ int py_getPlayerSkillWeapon(int, int); std::string py_getPlayerSpell(int, int); int py_getPlayerStrength(int); int py_getPlayerTalent(int, int); +std::string py_getPlayerUID(int); int py_getPlayerVirtualWorld(int); py::dict py_getPlayerVisual(int); int py_getPlayerWeaponMode(int); diff --git a/src/functions/sqfunctions.cpp b/src/functions/sqfunctions.cpp index f5a43cb..c71a34c 100644 --- a/src/functions/sqfunctions.cpp +++ b/src/functions/sqfunctions.cpp @@ -86,6 +86,7 @@ namespace nonut FUNCTION_CTOR(getPlayerSpell), FUNCTION_CTOR(getPlayerStrength), FUNCTION_CTOR(getPlayerTalent), + FUNCTION_CTOR(getPlayerUID), FUNCTION_CTOR(getPlayerVirtualWorld), FUNCTION_CTOR(getPlayerVisual), FUNCTION_CTOR(getPlayerWeaponMode), diff --git a/src/functions/sqfunctions.h b/src/functions/sqfunctions.h index 46485df..d76fb1a 100644 --- a/src/functions/sqfunctions.h +++ b/src/functions/sqfunctions.h @@ -99,6 +99,7 @@ namespace nonut Function getPlayerSpell; Function getPlayerStrength; Function getPlayerTalent; + Function getPlayerUID; Function getPlayerVirtualWorld; Function getPlayerVisual; Function getPlayerWeaponMode;