Ejemplo n.º 1
0
 void Test() override
 {
     switch (GetTestStep())
     {
         case 0:
         {
             Creature* c = SpawnCreature(1, 1);
             if (!c)
                 Fail("Failed to summon a creature");
             else if (c->GetMap() != GetMap())
                 Fail("Creature summoned on the wrong map");
             else if (!c->FindNearestCreature(NPC_MAGMADAR, 50.0f))
                 Fail("Unit magmadar not found near creature");
             SpawnPlayer(0, CLASS_WARLOCK, RACE_GNOME);
             Wait(500);
             NextStep();
             break;
         }
         case 1:
         {
             Player* p = GetTestPlayer(0);
             if (!p)
                 Fail("Unable to summon a player");
             else if (p->getClass() != CLASS_WARLOCK && p->getRace() != RACE_GNOME)
                 Fail("Bad player class or race");
             else if (p->FindMap() != GetMap())
                 Fail("Bad player map");
             else if (p->GetInstanceId() != GetMap()->GetInstanceId())
                 Fail("Diff instance id (player vs map)");
             else if (!p->FindNearestCreature(NPC_MAGMADAR, 50.0f))
                 Fail("Unit magmadar not found near player");
             else
                 Finish();
             return;
         }
     }
 }