Skip to content

Commit

Permalink
Scripts/Quest: Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Aokromes committed Jun 14, 2019
1 parent a0f2832 commit 5bd3d5d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,85 +115,6 @@ class npc_wounded_coldridge_mountaineer : public CreatureScript
}
};

/*####
## npc_wounded_milita
####*/

enum WoundedMilita
{
QUEST_KILL_CREDIT = 44175,
SPELL_FLASH_HEAL = 2061,
EVENT_RESET_HEALTH = 4
};

class npc_wounded_milita : public CreatureScript
{
public:
npc_wounded_milita() : CreatureScript("npc_wounded_milita") { }

struct npc_wounded_militaAI : public ScriptedAI
{
npc_wounded_militaAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}

void Initialize()
{
_hitBySpell = false;
_percentHP = urand(15, 55);
}

void Reset() override
{
Initialize();
me->SetHealth(me->CountPctFromMaxHealth(_percentHP));
}

void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!_hitBySpell)
{
_hitBySpell = true;
_events.ScheduleEvent(EVENT_RESET_HEALTH, Seconds(30));
}
if (spell->Id == SPELL_FLASH_HEAL)
if (Player* player = caster->ToPlayer())
player->KilledMonsterCredit(QUEST_KILL_CREDIT);
}

void UpdateAI(uint32 diff) override
{
if (!_hitBySpell)
return;

_events.Update(diff);

while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_RESET_HEALTH:
me->SetHealth(me->CountPctFromMaxHealth(_percentHP));
_hitBySpell = false;
break;
default:
break;
}
}
}
private:
EventMap _events;
int8 _percentHP;
bool _hitBySpell;
};

CreatureAI* GetAI(Creature* creature) const override
{
return new npc_wounded_militaAI(creature);
}
};

/*######
## npc_milos_gyro
######*/
Expand Down Expand Up @@ -463,7 +384,6 @@ class spell_low_health: public SpellScriptLoader
void AddSC_dun_morogh_area_coldridge_valley()
{
new npc_wounded_coldridge_mountaineer();
new npc_wounded_milita();
new npc_milos_gyro();
new spell_a_trip_to_ironforge_quest_complete();
new spell_follow_that_gyrocopter_quest_start();
Expand Down
44 changes: 0 additions & 44 deletions src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ EndScriptData */
/* ContentData
npc_draenei_survivor
npc_engineer_spark_overgrind
npc_injured_draenei
npc_magwin
go_ravager_cage
npc_death_ravager
Expand Down Expand Up @@ -278,48 +277,6 @@ class npc_engineer_spark_overgrind : public CreatureScript
}
};

/*######
## npc_injured_draenei
######*/

class npc_injured_draenei : public CreatureScript
{
public:
npc_injured_draenei() : CreatureScript("npc_injured_draenei") { }

struct npc_injured_draeneiAI : public ScriptedAI
{
npc_injured_draeneiAI(Creature* creature) : ScriptedAI(creature) { }

void Reset() override
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
me->SetHealth(me->CountPctFromMaxHealth(15));
switch (urand(0, 1))
{
case 0:
me->SetStandState(UNIT_STAND_STATE_SIT);
break;

case 1:
me->SetStandState(UNIT_STAND_STATE_SLEEP);
break;
}
}

void JustEngagedWith(Unit* /*who*/) override { }

void MoveInLineOfSight(Unit* /*who*/) override { }

void UpdateAI(uint32 /*diff*/) override { }
};

CreatureAI* GetAI(Creature* creature) const override
{
return new npc_injured_draeneiAI(creature);
}
};

/*######
## npc_magwin
######*/
Expand Down Expand Up @@ -721,7 +678,6 @@ void AddSC_azuremyst_isle()
{
new npc_draenei_survivor();
new npc_engineer_spark_overgrind();
new npc_injured_draenei();
new npc_magwin();
new npc_death_ravager();
new go_ravager_cage();
Expand Down

0 comments on commit 5bd3d5d

Please sign in to comment.