feat: changes due to G2O 0.3.0.6
+ added function getPlayerUID + changed event onPlayerSpellCast
This commit is contained in:
@@ -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
|
||||
|
||||
2
docs/functions/player/getPlayerUID.md
Normal file
2
docs/functions/player/getPlayerUID.md
Normal file
@@ -0,0 +1,2 @@
|
||||
#`function` getPlayerUID
|
||||
::: g2o.functions.player.getPlayerUID
|
||||
@@ -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:
|
||||
"""
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -99,6 +99,7 @@ namespace nonut
|
||||
Function<String, Int, Int> getPlayerSpell;
|
||||
Function<Int, Int> getPlayerStrength;
|
||||
Function<Int, Int, Int> getPlayerTalent;
|
||||
Function<String, Int> getPlayerUID;
|
||||
Function<Int, Int> getPlayerVirtualWorld;
|
||||
Function<SqDict, Int> getPlayerVisual;
|
||||
Function<Int, Int> getPlayerWeaponMode;
|
||||
|
||||
Reference in New Issue
Block a user