您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetSummoner函数代码示例

51自学网 2021-06-01 21:15:42
  C++
这篇教程C++ GetSummoner函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetSummoner函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSummoner函数的具体用法?C++ GetSummoner怎么用?C++ GetSummoner使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetSummoner函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime){    if (msTime)    {        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));        return;    }    //ASSERT(!IsPet());    if (IsPet())    {        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    //npcbot    if (GetIAmABot() || GetIAmABotsPet())    {        //TC_LOG_ERROR("entities.player", "TempSummon::UnSummon(): Trying to unsummon Bot %s (guidLow: %u owner: %s)", GetName().c_str(), GetGUIDLow(), GetBotOwner()->GetName().c_str());        if (IsTempBot())            AI()->JustDied(NULL);        return;    }    //end npcbots    AddObjectToRemoveList();}
开发者ID:GlassFace,项目名称:XC_CORE,代码行数:34,


示例2: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime){    if (msTime)    {        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));        return;    }    //ASSERT(!isPet());    if (isPet())    {        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();	   if (owner && GetEntry() == 30230) // Risen ally       {          owner->RemoveAurasDueToSpell(62218);          owner->RemoveAurasDueToSpell(46619);       }    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    AddObjectToRemoveList();}
开发者ID:DaShutok,项目名称:TrinityCore,代码行数:29,


示例3: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime){    if (msTime)    {        ForcedUnsummonDelayEvent *pEvent = new ForcedUnsummonDelayEvent(*this);        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));        return;    }    //ASSERT(!isPet());    if (isPet())    {        if(((Pet*)this)->getPetType() == HUNTER_PET)            ((Pet*)this)->Remove(PET_SAVE_AS_CURRENT);        else            ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    AddObjectToRemoveList();}
开发者ID:wuhongyi1977,项目名称:StrawberryCore,代码行数:27,


示例4: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime){    if (msTime)    {        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));        return;    }    //ASSERT(!isPet());    if (isPet())    {        if (ToPet()->getPetType() == HUNTER_PET)            ToPet()->Remove(PET_SLOT_ACTUAL_PET_SLOT, false, ToPet()->m_Stampeded);        else            ToPet()->Remove(PET_SLOT_OTHER_PET, false, ToPet()->m_Stampeded);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    AddObjectToRemoveList();}
开发者ID:Exodius,项目名称:JadeCore548,代码行数:27,


示例5: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime){     if (msTime)    {        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));        return;    }	// Dont allow to call this function twice (possible)	if (m_type == TEMPSUMMON_DESPAWNED)		return;	SetTempSummonType(TEMPSUMMON_DESPAWNED);    //ASSERT(!IsPet());    if (IsPet())    {        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    AddObjectToRemoveList();}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:29,


示例6: ASSERT

void TempSummon::UnSummon(){    //ASSERT(!isPet());    if (isPet())    {        if (((Pet*)this)->getPetType() == HUNTER_PET)            ((Pet*)this)->Remove(PET_SLOT_ACTUAL_PET_SLOT);        else            ((Pet*)this)->Remove(PET_SLOT_OTHER_PET);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    if (owner &&        owner->GetTypeId() == TYPEID_PLAYER &&       ((Player*)owner)->HaveBot() &&       ((Player*)owner)->GetBot()->GetGUID()==this->GetGUID() &&       this->isDead()) {    // dont unsummon corpse if a bot        return;    }    AddObjectToRemoveList();}
开发者ID:XEQT,项目名称:SkyFireEMU,代码行数:27,


示例7: GetSummoner

void TempSummon::InitSummon() {	Unit* owner = GetSummoner();	if (owner) {		if (owner->GetTypeId() == TYPEID_UNIT				&& owner->ToCreature()->IsAIEnabled)			owner->ToCreature()->AI()->JustSummoned(this);		if (IsAIEnabled)			AI()->IsSummonedBy(owner);	}}
开发者ID:rexy,项目名称:ArkCORE,代码行数:10,


示例8: GetSummoner

void TempSummon::InitSummon(){     Unit* owner = GetSummoner();    if (owner)    {        if (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)            owner->ToCreature()->AI()->JustSummoned(this);    }	// Xinef: Allow to call this hook when npc is summoned by gameobject, in this case pass this as summoner to avoid possible null checks	if (IsAIEnabled)		AI()->IsSummonedBy(owner);}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:13,


示例9: ASSERT

void TempSummon::UnSummon(){    if (isPet())    {        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    AddObjectToRemoveList();}
开发者ID:AwkwardDev,项目名称:Project-WoW,代码行数:15,


示例10: RemoveFromWorld

void TempSummon::RemoveFromWorld() {	if (!IsInWorld())		return;	if (m_Properties)		if (uint32 slot = m_Properties->Slot)			if (Unit* owner = GetSummoner())				if (owner->m_SummonSlot[slot] == GetGUID())					owner->m_SummonSlot[slot] = 0;	//if (GetOwnerGUID())	//    sLog->outError("Unit %u has owner guid when removed from world", GetEntry());	Creature::RemoveFromWorld();}
开发者ID:rexy,项目名称:ArkCORE,代码行数:15,


示例11: RemoveFromWorld

void TempSummon::RemoveFromWorld(){    if (!IsInWorld())        return;    if (m_Properties)        if (uint32 slot = m_Properties->Slot)            if (Unit* owner = GetSummoner())                if (owner->m_SummonSlot[slot] == GetGUID())                    owner->m_SummonSlot[slot].Clear();    //if (GetOwnerGUID())    //    TC_LOG_ERROR("entities.unit", "Unit %u has owner guid when removed from world", GetEntry());    Creature::RemoveFromWorld();}
开发者ID:GlassFace,项目名称:XC_CORE,代码行数:16,


示例12: ASSERT

void TempSummon::InitStats(uint32 duration){     ASSERT(!IsPet());    m_timer = duration;    m_lifetime = duration;    if (m_type == TEMPSUMMON_MANUAL_DESPAWN)        m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;    Unit* owner = GetSummoner();    if (owner)	{		if (IsTrigger() && m_spells[0])		{			setFaction(owner->getFaction());			SetLevel(owner->getLevel());			if (owner->GetTypeId() == TYPEID_PLAYER)				m_ControlledByPlayer = true;		}		if (owner->GetTypeId() == TYPEID_PLAYER)			m_CreatedByPlayer = true;    }    if (!m_Properties)        return;    if (owner)    {        if (uint32 slot = m_Properties->Slot)        {            if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())            {                Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);                if (oldSummon && oldSummon->IsSummon())                    oldSummon->ToTempSummon()->UnSummon();            }            owner->m_SummonSlot[slot] = GetGUID();        }    }    if (m_Properties->Faction)        setFaction(m_Properties->Faction);    else if (IsVehicle() && owner) // properties should be vehicle        setFaction(owner->getFaction());}
开发者ID:Cryostorm,项目名称:SunwellCore,代码行数:47,


示例13: ASSERT

void TempSummon::UnSummon(){    //ASSERT(!isPet());    if (isPet())    {        if (((Pet*)this)->getPetType() == HUNTER_PET)            ((Pet*)this)->Remove(PET_SLOT_ACTUAL_PET_SLOT);        else            ((Pet*)this)->Remove(PET_SLOT_OTHER_PET);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    AddObjectToRemoveList();}
开发者ID:kmishima,项目名称:DarkCore,代码行数:19,


示例14: ForcedUnsummonDelayEvent

void TempSummon::UnSummon(uint32 msTime){    if (msTime)    {        ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);        m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));        return;    }    // Custom operations    switch(GetEntry())    {        // Force of Nature        case 36070:            // If not it's directly handled in JustDied            if(IsAIEnabled && isAlive())            {                 AI()->JustDied(this);            }            break;    }    //ASSERT(!isPet());    if (isPet())    {        ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);        ASSERT(!IsInWorld());        return;    }    Unit* owner = GetSummoner();    if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)        owner->ToCreature()->AI()->SummonedCreatureDespawn(this);    AddObjectToRemoveList();}
开发者ID:Jildor,项目名称:4.3.4-Core,代码行数:37,


示例15: ASSERT

void TempSummon::InitStats(uint32 duration){    ASSERT(!isPet());    m_timer = duration;    m_lifetime = duration;    if (m_type == TEMPSUMMON_MANUAL_DESPAWN)        m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;    Unit* owner = GetSummoner();    if (owner && isTrigger() && m_spells[0])    {        setFaction(owner->getFaction());        SetLevel(owner->getLevel());        if (owner->GetTypeId() == TYPEID_PLAYER)            m_ControlledByPlayer = true;    }    if (!m_Properties)        return;    // Fix Force of Nature treants stats    if (owner && owner->getClass() == CLASS_DRUID && owner->HasSpell(106737))    {        float damage = 0.0f;        switch (GetEntry())        {        case ENTRY_TREANT_RESTO:        case ENTRY_TREANT_BALANCE:            SetMaxHealth(owner->CountPctFromMaxHealth(40));            break;        case ENTRY_TREANT_GUARDIAN:            SetMaxHealth(owner->CountPctFromMaxHealth(40));            // (Attack power / 14 * 2 * 0.75) * 0.2f            damage = ((owner->GetTotalAttackPowerValue(BASE_ATTACK) / 14.0f) * 2.0f * 0.75f) * 0.2f;            SetStatFloatValue(UNIT_FIELD_MINDAMAGE, damage);            SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, damage);        case ENTRY_TREANT_FERAL:            SetMaxHealth(owner->CountPctFromMaxHealth(40));            // Attack power / 14 * 2 * 0.75            damage = (owner->GetTotalAttackPowerValue(BASE_ATTACK) / 14.0f) * 2.0f * 0.75f;            SetStatFloatValue(UNIT_FIELD_MINDAMAGE, damage);            SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, damage);        default:            break;        }    }    if (owner)    {        if (uint32 slot = m_Properties->Slot)        {            if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())            {                Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);                if (oldSummon && oldSummon->IsSummon())                    oldSummon->ToTempSummon()->UnSummon();            }            owner->m_SummonSlot[slot] = GetGUID();        }    }    if (m_Properties->Faction)        setFaction(m_Properties->Faction);    else if (IsVehicle() && owner) // properties should be vehicle        setFaction(owner->getFaction());}
开发者ID:Exodius,项目名称:JadeCore548,代码行数:70,


示例16: switch

void TemporarySummon::Update(uint32 update_diff, uint32 diff){    TSUpdateActions ua = TSUA_NONE;    switch (m_type)    {        case TEMPSUMMON_MANUAL_DESPAWN:            break;        case TEMPSUMMON_DEAD_DESPAWN:        {            if (IsDespawned())                ua = TSUA_UNSUMMON;            break;        }        case TEMPSUMMON_CORPSE_DESPAWN:        {            // if m_deathState is DEAD, CORPSE was skipped            if (isDead())                ua = TSUA_UNSUMMON;            break;        }        case TEMPSUMMON_CORPSE_TIMED_DESPAWN:        {            if (IsDespawned())                ua = TSUA_UNSUMMON;            else if (IsCorpse())                ua = TSUA_CHECK_TIMER;            break;        }        case TEMPSUMMON_TIMED_DESPAWN:        {            ua = TSUA_CHECK_TIMER;            break;        }        case TEMPSUMMON_TIMED_OOC_DESPAWN:        {            ua = isInCombat() ? TSUA_RESET_TIMER : TSUA_CHECK_TIMER;            break;        }        case TEMPSUMMON_TIMED_OR_DEAD_DESPAWN:        {            ua = IsDespawned() ? TSUA_UNSUMMON : TSUA_CHECK_TIMER;            break;        }        case TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN:        {            // if m_deathState is DEAD, CORPSE was skipped            ua = isDead() ? TSUA_UNSUMMON : TSUA_CHECK_TIMER;            break;        }        case TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN:        {            if (IsDespawned())                ua = TSUA_UNSUMMON;            else                ua = (!isInCombat() && isAlive()) ? TSUA_CHECK_TIMER : TSUA_RESET_TIMER;            break;        }        case TEMPSUMMON_TIMED_OOC_OR_CORPSE_DESPAWN:        {            if (isDead())                ua = TSUA_UNSUMMON;            else                ua = isInCombat() ? TSUA_RESET_TIMER : TSUA_CHECK_TIMER;            break;        }        case TEMPSUMMON_LOST_OWNER_DESPAWN:        case TEMPSUMMON_DEAD_OR_LOST_OWNER_DESPAWN:        {            if (m_type == TEMPSUMMON_DEAD_OR_LOST_OWNER_DESPAWN && IsDespawned())                ua = TSUA_UNSUMMON;            else if (!GetSummoner())            {                m_type = TEMPSUMMON_TIMED_DESPAWN;                m_lifetime = DEFAULT_DESPAWN_DELAY;                ua = TSUA_RESET_TIMER;            }            break;        }        case TEMPSUMMON_TIMED_OR_DEAD_OR_LOST_OWNER_DESPAWN:        {            ua = (IsDespawned() || !GetSummoner()) ? TSUA_UNSUMMON : TSUA_CHECK_TIMER;            break;        }        case TEMPSUMMON_TIMED_OR_DEAD_OR_LOST_UNIQUENESS_DESPAWN:        {            ua = IsDespawned() ? TSUA_UNSUMMON : TSUpdateActions(TSUA_CHECK_UNIQUENESS | TSUA_CHECK_TIMER);            break;        }        case TEMPSUMMON_DEAD_OR_LOST_UNIQUENESS_DESPAWN:        {            ua = IsDespawned() ? TSUA_UNSUMMON : TSUA_CHECK_UNIQUENESS;            break;        }        default:            ua = TSUA_UNSUMMON;            sLog.outError("Temporary summoned %s have unknown type %u of", GetGuidStr().c_str(), m_type);            break;    }//.........这里部分代码省略.........
开发者ID:AnthoDevMoP,项目名称:mangos4,代码行数:101,



注:本文中的GetSummoner函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetSysColor函数代码示例
C++ GetSubMenu函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。