当前位置: 首页>>代码示例>>C++>>正文


C++ CreaturePointer::Load方法代码示例

本文整理汇总了C++中CreaturePointer::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ CreaturePointer::Load方法的具体用法?C++ CreaturePointer::Load怎么用?C++ CreaturePointer::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CreaturePointer的用法示例。


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

示例1: Temper

bool Temper(uint32 i, SpellPointer pSpell)
{
	if( !pSpell->u_caster )
		return false;

	UnitPointer _unit = pSpell->u_caster;

	//summon several Molten Golem's
	for( uint8 i=0; i<GOLEMS_COUNT; i++ )
	{
		CreatureProto *cp = CreatureProtoStorage.LookupEntry(MOLTEN_GOLEM_ENTRY);
		CreatureInfo *ci = CreatureNameStorage.LookupEntry(MOLTEN_GOLEM_ENTRY);
		CreaturePointer c = NULLCREATURE;
		if (cp && ci)
		{
			c = _unit->GetMapMgr()->CreateCreature( MOLTEN_GOLEM_ENTRY );
			if (c)
			{
				c->Load(cp, _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 0.0f);
				c->PushToWorld(_unit->GetMapMgr());
				c->SetUInt64Value( UNIT_FIELD_SUMMONEDBY, _unit->GetGUID() );
			}
		}
	}
	return true;
}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:26,代码来源:Instance_HallsOfLightning.cpp

示例2: OnCombatStart

    void OnCombatStart(UnitPointer mTarget)
    {
		_unit->SendChatMessage( CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "You wish to confront the master? You must weather the storm!");
		spark_timer = 0;
		last_creation_hp = 100;
		RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
		for( uint8 i=0; i<SPARKS_COUNT; i++)
		{
			CreatureProto *cp = CreatureProtoStorage.LookupEntry(28926);
			CreatureInfo *ci = CreatureNameStorage.LookupEntry(28926);
			CreaturePointer c = NULLCREATURE;
			if (cp && ci)
			{
				c = _unit->GetMapMgr()->CreateCreature( 28926 );
				if (c)
				{
					c->Load(cp,_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation());
					c->PushToWorld(_unit->GetMapMgr());
					sparks[i] = c->GetGUID();
					c->Root();
					c->GetAIInterface()->disable_combat = true;
					for( uint8 i=0; i<7; i++ )
						c->SchoolImmunityList[i] = 1;
				}
			}
		}
    }
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:27,代码来源:Instance_HallsOfLightning.cpp

示例3: SpawnCreature

CreaturePointer MapScriptInterface::SpawnCreature(uint32 Entry, float cX, float cY, float cZ, float cO, bool AddToWorld, bool tmplate, uint32 Misc1, uint32 Misc2)
{
	CreatureProto * proto = CreatureProtoStorage.LookupEntry(Entry);
	CreatureInfo * info = CreatureNameStorage.LookupEntry(Entry);
	if(proto == 0 || info == 0)
	{
		return NULLCREATURE;
	}

	CreatureSpawn * sp = new CreatureSpawn;
	sp->entry = Entry;
	sp->form = 0;
	sp->id = 0;
	sp->movetype = 0;
	sp->x = cX;
	sp->y = cY;
	sp->z = cZ;
	sp->o = cO;
	sp->emote_state =0;
	sp->flags = 0;
	sp->factionid = proto->Faction;
	sp->bytes=0;
	sp->bytes1=0;
	sp->bytes2=0;
	sp->displayid=0;
	sp->stand_state = 0;
	sp->channel_spell=sp->channel_target_creature=sp->channel_target_go=0;
	sp->MountedDisplayID = 0;
	sp->phase = 1;
	sp->vehicle = proto->vehicle_entry;

	CreaturePointer p = this->mapMgr->CreateCreature(Entry);
	ASSERT(p);
	p->Load(sp, (uint32)NULL, NULL);
	p->spawnid = 0;
	p->m_spawn = NULL;
	delete sp;

	if( AddToWorld )
		p->PushToWorld(mapMgr);

	return p;
}
开发者ID:CadeLaRen,项目名称:Xeon-MMORPG-Emulator,代码行数:43,代码来源:MapScriptInterface.cpp


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