本文整理汇总了C++中PlayerPointer::_HasSkillLine方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPointer::_HasSkillLine方法的具体用法?C++ PlayerPointer::_HasSkillLine怎么用?C++ PlayerPointer::_HasSkillLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerPointer
的用法示例。
在下文中一共展示了PlayerPointer::_HasSkillLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GossipSelectOption
void GossipSelectOption(ObjectPointer pObject, PlayerPointer plr, uint32 Id, uint32 IntId, const char * Code)
{
GossipMenu * Menu;
switch (IntId) // switch and case 0 can be deleted, but I added it, because in future maybe we will have to expand script with more options.
{
case 0:
GossipHello(pObject, plr, true);
break;
case 1:
{
if (!plr->_HasSkillLine(164) || plr->_GetSkillLineCurrent(164, false) < 300)
{
//pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Only skilled blacksmiths can obtain this knowledge." );
SendQuickMenu(20001);
}
else if (!plr->HasSpell(9787))
{
//pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You need to know Weaponsmith first to learn anything more from me." );
SendQuickMenu(20002);
}
else if (plr->HasSpell(17040))
{
//pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You already know that." );
SendQuickMenu(20003);
}
else if (plr->HasSpell(17041) || plr->HasSpell(17039) || plr->HasSpell(9788))
{
//pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You already know one specialization." );
SendQuickMenu(20004);
}
else
{
if ( plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < 600 )
{
//pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You need 6 silver coins to learn this skill.");
SendQuickMenu(20005);
}
else
{
//pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Make good use of this knowledge." );
SendQuickMenu(20006);
CreaturePointer Trainer = TO_CREATURE(pObject);
Trainer->CastSpell(plr, 39099, true);
int32 gold = plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
plr->SetUInt32Value(PLAYER_FIELD_COINAGE, gold - 600);
}
}
}break;
case 2:
{
if (!plr->HasSpell(17040))
{
SendQuickMenu(20007);
}
else if ((plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < 250000 && plr->getLevel() <= 50) ||
(plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < 500000 && plr->getLevel() > 50 && plr->getLevel() <= 65) ||
(plr->GetUInt32Value(PLAYER_FIELD_COINAGE) < 1000000 && plr->getLevel() > 65))
{
SendQuickMenu(20008);
}
else
{
int32 unlearnGold;
if (plr->getLevel() <= 50)
unlearnGold = 250000;
if (plr->getLevel() > 50 && plr->getLevel() <= 65)
unlearnGold = 500000;
if (plr->getLevel() > 65)
unlearnGold = 1000000;
plr->SetUInt32Value(PLAYER_FIELD_COINAGE, plr->GetUInt32Value(PLAYER_FIELD_COINAGE) - unlearnGold);
plr->removeSpell(17040, false, false, 0);
SendQuickMenu(20009);
}
}break;
}
}