11
This commit is contained in:
45
test/函数块.cpp
45
test/函数块.cpp
@@ -251,7 +251,7 @@ void RegisterNutApi(const wchar_t* funcName, void* funcAddr, uint32_t v)
|
||||
if (!v)
|
||||
v = GetSqVm();
|
||||
SQPushRootTable(v);
|
||||
RealSqPushString(v, funcName, -1);
|
||||
SQPushString(v, funcName, -1);
|
||||
RealSqNewClosure(v, funcAddr, 0);
|
||||
SQNewSlot(v, -3, false);
|
||||
SQPopTop(v);
|
||||
@@ -464,6 +464,48 @@ static SQInteger GivePlayerEqu(HSQUIRRELVM v)
|
||||
return 1;
|
||||
}
|
||||
|
||||
//去副本
|
||||
static int GoDungeon(uint32_t v)
|
||||
{
|
||||
int n1 = 0;
|
||||
int n2 = 0;
|
||||
int n3 = 0;
|
||||
int n4 = 0;
|
||||
|
||||
int num;
|
||||
num = SQGetTop(v);
|
||||
|
||||
if (num == 2)
|
||||
{
|
||||
SQGetInt(v, 2, &n1);
|
||||
}
|
||||
else if (num == 5)
|
||||
{
|
||||
SQGetInt(v, 2, &n1);
|
||||
SQGetInt(v, 3, &n2);
|
||||
SQGetInt(v, 4, &n3);
|
||||
SQGetInt(v, 5, &n4);
|
||||
}
|
||||
else
|
||||
{
|
||||
SQPushBool(v, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
_SendpacksType(*_SendClass, 0, 15);
|
||||
_SendPacks();
|
||||
|
||||
_SendpacksType(*_SendClass, 0, 16);
|
||||
_SendPacksWord(*_SendClass, 0, n1);
|
||||
_SendPacksByte(*_SendClass, 0, n2);
|
||||
_SendPacksByte(*_SendClass, 0, n3);
|
||||
_SendPacksByte(*_SendClass, 0, n4);
|
||||
_SendPacks();
|
||||
|
||||
SQPushBool(v, true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void RegisterNut()
|
||||
{
|
||||
RegisterNutApi(L"L_sq_Test", sq_Test);
|
||||
@@ -480,6 +522,7 @@ void RegisterNut()
|
||||
RegisterNutApi(L"L_sq_SendPack", SendPack);
|
||||
RegisterNutApi(L"L_sq_GivePlayerItem", GivePlayerItem);
|
||||
RegisterNutApi(L"L_sq_GivePlayerEqu", GivePlayerEqu);
|
||||
RegisterNutApi(L"L_sq_GoDungeon", GoDungeon);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user