* Rename InstanceData to InstanceScript
* Rename *mgr to their new names in scripts project * Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker. --HG-- branch : trunk rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -22,97 +22,96 @@
|
||||
####*/
|
||||
#define SPELL_REVIVE 51918
|
||||
#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!"
|
||||
|
||||
struct npc_valkyr_battle_maidenAI : public PassiveAI
|
||||
␍class npc_valkyr_battle_maiden : public CreatureScript
|
||||
{
|
||||
npc_valkyr_battle_maidenAI(Creature *c) : PassiveAI(c) {}
|
||||
public:
|
||||
npc_valkyr_battle_maiden() : CreatureScript("npc_valkyr_battle_maiden") { }
|
||||
|
||||
uint32 FlyBackTimer;
|
||||
float x, y, z;
|
||||
uint32 phase;
|
||||
|
||||
void Reset()
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
me->setActive(true);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFlying(true);
|
||||
FlyBackTimer = 500;
|
||||
phase = 0;
|
||||
|
||||
me->GetPosition(x, y, z);
|
||||
z += 4; x -= 3.5; y -= 5;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
|
||||
return new npc_valkyr_battle_maidenAI (pCreature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
struct npc_valkyr_battle_maidenAI : public PassiveAI
|
||||
{
|
||||
if (FlyBackTimer <= diff)
|
||||
npc_valkyr_battle_maidenAI(Creature *c) : PassiveAI(c) {}
|
||||
|
||||
uint32 FlyBackTimer;
|
||||
float x, y, z;
|
||||
uint32 phase;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Player *plr = NULL;
|
||||
if (me->isSummon())
|
||||
if (Unit *summoner = CAST_SUM(me)->GetSummoner())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||
plr = CAST_PLR(summoner);
|
||||
me->setActive(true);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFlying(true);
|
||||
FlyBackTimer = 500;
|
||||
phase = 0;
|
||||
|
||||
if (!plr)
|
||||
phase = 3;
|
||||
me->GetPosition(x, y, z);
|
||||
z += 4; x -= 3.5; y -= 5;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
|
||||
}
|
||||
|
||||
switch(phase)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (FlyBackTimer <= diff)
|
||||
{
|
||||
case 0:
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
|
||||
FlyBackTimer = 500;
|
||||
break;
|
||||
case 1:
|
||||
plr->GetClosePoint(x,y,z, me->GetObjectSize());
|
||||
z += 2.5; x -= 2; y -= 1.5;
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
FlyBackTimer = 4500;
|
||||
break;
|
||||
case 2:
|
||||
if (!plr->isRessurectRequested())
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
|
||||
DoCast(plr, SPELL_REVIVE, true);
|
||||
me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
|
||||
}
|
||||
FlyBackTimer = 5000;
|
||||
break;
|
||||
case 3:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
FlyBackTimer = 3000;
|
||||
break;
|
||||
case 4:
|
||||
me->DisappearAndDie();
|
||||
break;
|
||||
default:
|
||||
//Nothing To DO
|
||||
break;
|
||||
}
|
||||
++phase;
|
||||
} else FlyBackTimer-=diff;
|
||||
}
|
||||
Player *plr = NULL;
|
||||
if (me->isSummon())
|
||||
if (Unit *summoner = CAST_SUM(me)->GetSummoner())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||
plr = CAST_PLR(summoner);
|
||||
|
||||
if (!plr)
|
||||
phase = 3;
|
||||
|
||||
switch(phase)
|
||||
{
|
||||
case 0:
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
|
||||
FlyBackTimer = 500;
|
||||
break;
|
||||
case 1:
|
||||
plr->GetClosePoint(x,y,z, me->GetObjectSize());
|
||||
z += 2.5; x -= 2; y -= 1.5;
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
FlyBackTimer = 4500;
|
||||
break;
|
||||
case 2:
|
||||
if (!plr->isRessurectRequested())
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
|
||||
DoCast(plr, SPELL_REVIVE, true);
|
||||
me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
|
||||
}
|
||||
FlyBackTimer = 5000;
|
||||
break;
|
||||
case 3:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
FlyBackTimer = 3000;
|
||||
break;
|
||||
case 4:
|
||||
me->DisappearAndDie();
|
||||
break;
|
||||
default:
|
||||
//Nothing To DO
|
||||
break;
|
||||
}
|
||||
++phase;
|
||||
} else FlyBackTimer-=diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature* pCreature)
|
||||
{
|
||||
return new npc_valkyr_battle_maidenAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_the_scarlet_enclave()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_valkyr_battle_maiden";
|
||||
newscript->GetAI = &GetAI_npc_valkyr_battle_maiden;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
// Chapter 3: Scarlet Armies Approach... - An End To All Things...
|
||||
// Chapter 4: An End To All Things... - An End To All Things...
|
||||
new npc_valkyr_battle_maiden();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user