本文整理汇总了C++中LPCHARACTER::GetPetSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetPetSystem方法的具体用法?C++ LPCHARACTER::GetPetSystem怎么用?C++ LPCHARACTER::GetPetSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetPetSystem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pet_summon
// syntax in LUA: pet.summon(mob_vnum, pet's name, (bool)run to me from far away)
int pet_summon(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
CPetSystem* petSystem = ch->GetPetSystem();
LPITEM pItem = CQuestManager::instance().GetCurrentItem();
if (!ch || !petSystem || !pItem)
{
lua_pushnumber (L, 0);
return 1;
}
if (0 == petSystem)
{
lua_pushnumber (L, 0);
return 1;
}
// 소환수의 vnum
DWORD mobVnum= lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;
// 소환수의 이름
const char* petName = lua_isstring(L, 2) ? lua_tostring(L, 2) : 0;
// 소환하면 멀리서부터 달려오는지 여부
bool bFromFar = lua_isboolean(L, 3) ? lua_toboolean(L, 3) : false;
CPetActor* pet = petSystem->Summon(mobVnum, pItem, petName, bFromFar);
if (pet != NULL)
lua_pushnumber (L, pet->GetVID());
else
lua_pushnumber (L, 0);
return 1;
}
示例2: pet_count_summoned
// syntax: pet.unsummon(mob_vnum)
int pet_count_summoned(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
CPetSystem* petSystem = ch->GetPetSystem();
lua_Number count = 0;
if (0 != petSystem)
count = (lua_Number)petSystem->CountSummoned();
lua_pushnumber(L, count);
return 1;
}
示例3: pet_unsummon
// syntax: pet.unsummon(mob_vnum)
int pet_unsummon(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
CPetSystem* petSystem = ch->GetPetSystem();
if (0 == petSystem)
return 0;
// 소환수의 vnum
DWORD mobVnum= lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;
petSystem->Unsummon(mobVnum);
return 1;
}
示例4: pet_is_summon
// syntax: pet.is_summon(mob_vnum)
int pet_is_summon(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
CPetSystem* petSystem = ch->GetPetSystem();
if (0 == petSystem)
return 0;
// 소환수의 vnum
DWORD mobVnum= lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;
CPetActor* petActor = petSystem->GetByVnum(mobVnum);
if (NULL == petActor)
lua_pushboolean(L, false);
else
lua_pushboolean(L, petActor->IsSummoned());
return 1;
}
示例5: pet_spawn_effect
int pet_spawn_effect(lua_State* L)
{
LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
CPetSystem* petSystem = ch->GetPetSystem();
if (0 == petSystem)
return 0;
DWORD mobVnum = lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0;
CPetActor* petActor = petSystem->GetByVnum(mobVnum);
if (NULL == petActor)
return 0;
LPCHARACTER pet_ch = petActor->GetCharacter();
if (NULL == pet_ch)
return 0;
if (lua_isstring(L, 2))
{
pet_ch->SpecificEffectPacket (lua_tostring(L, 2));
}
return 0;
}