本文整理汇总了C++中DoScriptText函数的典型用法代码示例。如果您正苦于以下问题:C++ DoScriptText函数的具体用法?C++ DoScriptText怎么用?C++ DoScriptText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoScriptText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpellHit
void SpellHit(Unit *source, const SpellEntry *spell)
{
if (spell->Mechanic == MECHANIC_DISARM)
DoScriptText(SAY_DISARMED, m_creature);
}
示例2: EndingPhase
void EndingPhase()
{
if( m_uiEndingTimer )
{
switch(m_uiEndingPhase)
{
case 1:
me->GetMotionMaster()->MoveIdle();
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
me->CastStop();
DoResetThreat();
DoScriptText(SAY_10_PROZENT, me);
DoCastAOE(SPELL_FURY_OF_FROSTMOURNE);
KingEnding(5000);
break;
case 2:
KingEnding(10000);
break;
case 3:
DoScriptText(SAY_ENDING_1_KING, me);
KingEnding(24000);
break;
case 4:
DoScriptText(SAY_ENDING_2_KING, me);
KingEnding(25000);
break;
case 5:
me->GetMotionMaster()->MovePoint(0, MoveEndingPosition);
KingEnding(4000);
break;
case 6:
DoCastAOE(SPELL_CHANNEL_KING);
DoScriptText(SAY_ENDING_3_KING, me);
KingEnding(26000);
break;
case 7:
DoScriptText(SAY_ENDING_4_KING, me);
KingEnding(9000);
break;
case 8:
DoScriptText(SAY_ENDING_5_TIRION, pTirion);
KingEnding(9000);
break;
case 9:
DoCast(pTirion, SPELL_TIRION_LIGHT);
KingEnding(5000);
break;
case 10:
pTirion->RemoveAurasDueToSpell(SPELL_ICEBLOCK_TRIGGER);
KingEnding(2000);
break;
case 11:
pTirion->GetMotionMaster()->MovePoint(0, MoveTirionFrostmourne);
KingEnding(1000);
break;
case 12:
pTirion->GetMotionMaster()->MoveJump(517.482910, -2124.905762, 1040.861328, 10.0f, 15.0f); //pTirion->JumpTo(pFrostmourne, 15.0f);
pTirion->SetUInt32Value(UNIT_NPC_EMOTESTATE, 375);
KingEnding(1000);
break;
case 13:
me->RemoveAura(SPELL_CHANNEL_KING);
me->CastSpell(me, SPELL_BOOM_VISUAL, false);
KingEnding(300);
break;
case 14:
me->CastSpell(me, SPELL_SUMMON_BROKEN_FROSTMOURNE, false);
KingEnding(3000);
break;
case 15:
me->CastSpell(me, 73017, false);
KingEnding(1000);
break;
case 16:
DoScriptText(SAY_ENDING_6_KING, me);
KingEnding(3000);
break;
case 17:
pFrostmourne = me->SummonCreature(27880, me->GetPositionX()+2, me->GetPositionY()+2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 99999999);
pFrostmourne->CastSpell(pFrostmourne, SPELL_BROKEN_FROSTMOURNE, false);
pFrostmourne->CastSpell(pFrostmourne, SPELL_FROSTMOURNE_TRIGGER, false);
pFrostmourne->GetMotionMaster()->MoveChase(me);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED);
//pTirion->CastSpell(pTirion, SPELL_DISENGAGE, false);
KingEnding(2000);
break;
case 18:
me->RemoveAllAuras();
me->RemoveAura(SPELL_SUMMON_BROKEN_FROSTMOURNE);
DoScriptText(SAY_ENDING_7_KING, me);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 473);
KingEnding(5000);
break;
case 19:
DoScriptText(SAY_ENDING_8_TIRION, pTirion);
KingEnding(6000);
break;
case 20:
pFather = me->SummonCreature(CREAUTRE_MENETHIL, me->GetPositionX()+5, me->GetPositionY()+5, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 9999999);
//.........这里部分代码省略.........
示例3: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
switch (stage)
{
case 0: {
bsw->timedCast(SPELL_FEROCIOUS_BUTT, uiDiff);
bsw->timedCast(SPELL_ARCTIC_BREATH, uiDiff);
bsw->timedCast(SPELL_WHIRL, uiDiff);
if (bsw->timedQuery(SPELL_MASSIVE_CRASH, uiDiff)) stage = 1;
bsw->timedCast(SPELL_FROTHING_RAGE, uiDiff);
DoMeleeAttackIfReady();
break;
}
case 1: {
if (bsw->doCast(SPELL_MASSIVE_CRASH) == CAST_OK)
stage = 2;
break;
}
case 2: {
if (pTarget = bsw->SelectUnit()) {
TrampleCasted = false;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
stage = 3;
bsw->resetTimer(SPELL_TRAMPLE);
DoScriptText(-1713506,me,pTarget);
SetCombatMovement(false);
me->GetMotionMaster()->MoveIdle();
}
break;
}
case 3: {
if (bsw->timedQuery(SPELL_TRAMPLE,uiDiff)) {
pTarget->GetPosition(fPosX, fPosY, fPosZ);
TrampleCasted = false;
MovementStarted = true;
me->GetMotionMaster()->MovePoint(1, fPosX, fPosY, fPosZ);
DoScriptText(-1713508,me);
bsw->doCast(SPELL_ADRENALINE);
stage = 4;
}
break;
}
case 4: {
if (MovementStarted)
{
Map* pMap = me->GetMap();
Map::PlayerList const &lPlayers = pMap->GetPlayers();
for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
{
Unit* pPlayer = itr->getSource();
if (!pPlayer) continue;
if (pPlayer->isAlive() && pPlayer->IsWithinDistInMap(me, 5.0f)) {
bsw->doCast(SPELL_TRAMPLE, pPlayer);
TrampleCasted = true;
MovementStarted = false;
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveChase(me->getVictim());
}
}
} else stage = 5;
if (TrampleCasted) stage = 5;
break;
}
case 5: {
if (!TrampleCasted) {
bsw->doCast(SPELL_STAGGERED_DAZE);
DoScriptText(-1713507,me);
}
MovementStarted = false;
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveChase(me->getVictim());
SetCombatMovement(true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
stage = 0;
break;
}
}
}
示例4: KilledUnit
void KilledUnit(Unit *victim)
{
if(!m_bIsDeathPhase)
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
示例5: JustDied
void JustDied(Unit* /*Killer*/)
{
if (!IsImage)
DoScriptText(SAY_DEATH, me);
}
示例6: DoSplit
void DoSplit(int atPercent /* 75 50 25 */)
{
DoScriptText(SAY_SPLIT, me);
ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227f, 2083.814453f, 125.648788f, 0);
ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875f, 2118.504639f, 133.058151f, 0);
ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266f, 2058.231201f, 133.058151f, 0);
ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3;
switch (urand(0, 2))
{
case 0:
bossc=place1;
i1=place2;
i2=place3;
break;
case 1:
bossc=place2;
i1=place1;
i2=place3;
break;
case 2:
bossc=place3;
i1=place1;
i2=place2;
break;
}
for (uint16 i = 0; i < 41; ++i)
{
if (Player* target = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)))
{
if (Group* pGrp = target->GetGroup())
for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico)
{
//if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :(
pGrp->SetTargetIcon(ico, 0, 0);
}
break;
}
}
me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisible(false);
me->SetPosition(bossc->x, bossc->y, bossc->z, bossc->r);
Invisible = true;
DoResetThreat();
DoStopAttack();
switch (atPercent)
{
case 75: Images75 = true; break;
case 50: Images50 = true; break;
case 25: Images25 = true; break;
}
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
Creature* Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if (Image1)
{
Image1->SetMaxHealth(me->GetMaxHealth() / 5);
Image1->SetHealth(me->GetHealth() / 5);
if (target)
Image1->AI()->AttackStart(target);
CAST_AI(boss_skeram::boss_skeramAI, Image1->AI())->IsImage = true;
}
Creature* Image2 = me->SummonCreature(15263, i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if (Image2)
{
Image2->SetMaxHealth(me->GetMaxHealth() / 5);
Image2->SetHealth(me->GetHealth() / 5);
if (target)
Image2->AI()->AttackStart(target);
CAST_AI(boss_skeram::boss_skeramAI, Image2->AI())->IsImage = true;
}
Invisible = true;
delete place1;
delete place2;
delete place3;
}
示例7: KilledUnit
void KilledUnit(Unit* /*Victim*/) {
DoScriptText(SAY_KILL, me);
}
示例8: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
{
if(UnsummonCheck < diff && m_creature->isAlive())
{
m_creature->SetLootRecipient(NULL);
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
}else UnsummonCheck -= diff;
return;
}
if(Fireball_Timer < diff)
{
if(Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(victim, SPELL_FIREBALL,true);
Fireball_Timer = 4000+rand()%3000;
}else Fireball_Timer -= diff;
if(flight) // phase 1 - the flight
{
Creature *Vazruden = Unit::GetCreature(*m_creature,VazrudenGUID);
if(Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth())))
{
flight = false;
BellowingRoar_Timer = 6000;
ConeOfFire_Timer = 12000;
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->GetMotionMaster()->Clear();
if(Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0))
m_creature->AI()->AttackStart(victim);
DoStartMovement(m_creature->getVictim());
DoScriptText(EMOTE, m_creature);
return;
}else Fly_Timer -= diff;
if(Turn_Timer < diff)
{
uint32 waypoint = (Fly_Timer/10000)%2;
if(m_creature->GetDistance(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]) > 5)
m_creature->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]);
Turn_Timer = 10000;
}else Turn_Timer -= diff;
}
else // phase 2 - land fight
{
if(ConeOfFire_Timer < diff)
{
DoCast(m_creature, SPELL_CONE_OF_FIRE);
ConeOfFire_Timer = 12000;
Fireball_Timer = 4000;
}else ConeOfFire_Timer -= diff;
if(HeroicMode && BellowingRoar_Timer < diff)
{
DoCast(m_creature, SPELL_BELLOWING_ROAR);
BellowingRoar_Timer = 45000;
}else BellowingRoar_Timer -= diff;
DoMeleeAttackIfReady();
}
}
示例9: EnterCombat
void EnterCombat(Unit* /*who*/) {
DoScriptText(SAY_AGGRO, me);
if (instance)
instance->SetData(DATA_CYANIGOSA_EVENT, IN_PROGRESS);
}
示例10: EnterCombat
void EnterCombat(Unit * /*who*/) {
DoScriptText(SAY_AGGRO, me);
}
示例11: KilledUnit
void KilledUnit(Unit * victim) {
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
}
示例12: UpdateAI
void UpdateAI(const uint32 uiDiff)
{
if(m_uiBirthState == 1)
if(m_uiBirthTimer < uiDiff)
{
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->setFaction(21);
m_uiBirthState = 2;
}
else
m_uiBirthTimer -= uiDiff;
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
if (m_uiBeserkTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL_BESERK) == CAST_OK)
{
m_uiBeserkTimer = 300000;
DoScriptText(EMOTE_ENRAGE, m_creature);
}
}
else
m_uiBeserkTimer -= uiDiff;
if (m_uiPhase == 1)
{
if (m_uiLifeDrainTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_LIFE_DRAIN : H_SPELL_LIFE_DRAIN) == CAST_OK)
m_uiLifeDrainTimer = 24000;
}
}
else
m_uiLifeDrainTimer -= uiDiff;
if (m_uiBlizzardTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_BLIZZARD : H_SPELL_BLIZZARD) == CAST_OK)
m_uiBlizzardTimer = urand(17,20)*IN_MILLISECONDS;
}
}
else
m_uiBlizzardTimer -= uiDiff;
if (m_uiCleaveTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK)
m_uiCleaveTimer = urand(7000, 10000);
}
else
m_uiCleaveTimer -= uiDiff;
if (m_uiTailSweepTimer < uiDiff)
{
if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_TAIL_SWEEP : H_SPELL_TAIL_SWEEP) == CAST_OK)
m_uiTailSweepTimer = urand(10000, 15000);
}
else
m_uiTailSweepTimer -= uiDiff;
if (m_creature->GetHealthPercent() > 10.0f)
{
if (m_uiFlyTimer < uiDiff)
{
m_uiPhase = 2;
m_creature->InterruptNonMeleeSpells(false);
m_creature->HandleEmote(EMOTE_ONESHOT_LIFTOFF);
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
DoCastSpellIfCan(m_creature,11010);
m_creature->SetHover(true);
DoCastSpellIfCan(m_creature,18430);
m_uiIceboltTimer = 4000;
m_uiIceboltCount = 0;
m_bLandoff = false;
DoScriptText(EMOTE_FLY, m_creature);
}
else
m_uiFlyTimer -= uiDiff;
}
DoMeleeAttackIfReady();
}
else // Phase 2
{
if (m_uiIceboltCount < m_uiIceboltCountMax)
{
if (m_uiIceboltTimer < uiDiff)
{
if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0))
{
if(DoCastSpellIfCan(pTarget,SPELL_ICEBOLT) == CAST_OK)
{
targetGUIDs.push_back(pTarget->GetGUID());
//.........这里部分代码省略.........
示例13: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
return;
//Check for Frost Bolt
if (FrostBolt_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FROST_BOLT);
FrostBolt_Timer = (rand()%60)*1000;
}else FrostBolt_Timer -= diff;
//Check for Frost Bolt Nova
if (FrostBoltNova_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FROST_BOLT_NOVA);
FrostBoltNova_Timer = 15000;
}else FrostBoltNova_Timer -= diff;
//Check for Chains Of Kelthuzad
if (ChainsOfKelthuzad_Timer < diff)
{
//DoCast(m_creature->getVictim(),SPELL_CHAINS_OF_KELTHUZAD);
//if (rand()%2)
//DoScriptText(SAY_CHAIN1, m_creature);
//else
//DoScriptText(SAY_CHAIN2, m_creature);
ChainsOfKelthuzad_Timer = (rand()%30+30)*1000;
}else ChainsOfKelthuzad_Timer -= diff;
//Check for Mana Detonation
if (ManaDetonation_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_MANA_DETONATION);
if (rand()%2)
DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature);
ManaDetonation_Timer = 20000;
}else ManaDetonation_Timer -= diff;
//Check for Shadow Fissure
if (ShadowFisure_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SHADOW_FISURE);
if (rand()%2)
DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature);
ShadowFisure_Timer = 25000;
}else ShadowFisure_Timer -= diff;
//Check for Frost Blast
if (FrostBlast_Timer < diff)
{
DoCast(m_creature->getVictim(),SPELL_FROST_BLAST);
if (rand()%2)
DoScriptText(SAY_FROST_BLAST, m_creature);
FrostBlast_Timer = (rand()%30+30)*1000;
}else FrostBlast_Timer -= diff;
//start phase 3 when we are 40% health
if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40)
{
Phase3 = true;
DoScriptText(SAY_REQUEST_AID, m_creature);
//here Lich King should respond to KelThuzad but I don't know which creature to make talk
//so for now just make Kelthuzad says it.
DoScriptText(SAY_ANSWER_REQUEST, m_creature);
}
if (Phase3 && (GuardiansOfIcecrown_Count < 5))
{
if (GuardiansOfIcecrown_Timer < diff)
{
//Summon a Guardian of Icecrown in a random alcove (Creature # 16441)
//uint32 TimeToWalk;
Creature* pUnit = NULL;
float Walk_Pos_X;
float Walk_Pos_Y;
float Walk_Pos_Z;
switch(rand()%6)
{
case 0:
pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_FAR,ADDY_LEFT_FAR,ADDZ_LEFT_FAR,ADDO_LEFT_FAR,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
//Setting walk position
Walk_Pos_X = WALKX_LEFT_FAR;
Walk_Pos_Y = WALKY_LEFT_FAR;
Walk_Pos_Z = WALKZ_LEFT_FAR;
break;
case 1:
pUnit = m_creature->SummonCreature(16441,ADDX_LEFT_MIDDLE,ADDY_LEFT_MIDDLE,ADDZ_LEFT_MIDDLE,ADDO_LEFT_MIDDLE,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,1000);
//Start moving guardian towards the center of the room
Walk_Pos_X = WALKX_LEFT_MIDDLE;
//.........这里部分代码省略.........
示例14: KilledUnit
void KilledUnit(Unit* pVictim)
{
DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature);
}
示例15: KilledUnit
void KilledUnit(Unit* Victim)
{
if(!(rand()%5))
DoScriptText(SAY_SLAY, me);
}