Some faction fixes

This commit is contained in:
mik1893
2016-08-03 21:06:30 +01:00
committed by Yehonal
parent a6a771a6e0
commit 88700a7c8c

View File

@@ -60,7 +60,7 @@ class npc_pet_gen_mojo : public CreatureScript
me->HandleEmoteCommand(emote); me->HandleEmoteCommand(emote);
Unit* owner = me->GetOwner(); Unit* owner = me->GetOwner();
if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER ||
owner->ToPlayer()->GetTeamId() != player->GetTeamId()) owner->ToPlayer()->GetTeamId(true) != player->GetTeamId(true))
{ {
return; return;
} }
@@ -255,13 +255,13 @@ public:
{ {
_state = ARGENT_PONY_STATE_ENCH; _state = ARGENT_PONY_STATE_ENCH;
aura = (player->GetTeamId() == TEAM_ALLIANCE ? SPELL_AURA_TIRED_S : SPELL_AURA_TIRED_G); aura = (player->GetTeamId(true) == TEAM_ALLIANCE ? SPELL_AURA_TIRED_S : SPELL_AURA_TIRED_G);
duration = player->GetSpellCooldownDelay(aura); duration = player->GetSpellCooldownDelay(aura);
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
for (uint8 i = 0; i < 3; ++i) for (uint8 i = 0; i < 3; ++i)
{ {
if (player->GetTeamId() == TEAM_ALLIANCE) if (player->GetTeamId(true) == TEAM_ALLIANCE)
{ {
if (uint32 cooldown = player->GetSpellCooldownDelay(SPELL_AURA_POSTMAN_S+i)) if (uint32 cooldown = player->GetSpellCooldownDelay(SPELL_AURA_POSTMAN_S+i))
{ {
@@ -286,7 +286,7 @@ public:
} }
// Generate Banners // Generate Banners
uint32 mask = player->GetTeamId() ? RACEMASK_HORDE : RACEMASK_ALLIANCE; uint32 mask = player->GetTeamId(true) ? RACEMASK_HORDE : RACEMASK_ALLIANCE;
for (uint8 i = 1; i < MAX_RACES; ++i) for (uint8 i = 1; i < MAX_RACES; ++i)
if (mask & (1 << (i-1)) && player->HasAchieved(argentBanners[i].achievement)) if (mask & (1 << (i-1)) && player->HasAchieved(argentBanners[i].achievement))
_banners[i] = true; _banners[i] = true;
@@ -351,7 +351,7 @@ public:
if (player->GetGUID() != creature->GetOwnerGUID()) if (player->GetGUID() != creature->GetOwnerGUID())
return true; return true;
if (!creature->HasAura(player->GetTeamId() ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S)) if (!creature->HasAura(player->GetTeamId(true) ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S))
{ {
uint8 _state = creature->AI()->GetData(0 /*GET_DATA_STATE*/); uint8 _state = creature->AI()->GetData(0 /*GET_DATA_STATE*/);
if (_state == ARGENT_PONY_STATE_ENCH || _state == ARGENT_PONY_STATE_VENDOR) if (_state == ARGENT_PONY_STATE_ENCH || _state == ARGENT_PONY_STATE_VENDOR)
@@ -379,20 +379,20 @@ public:
case GOSSIP_ACTION_TRADE: case GOSSIP_ACTION_TRADE:
creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR);
player->GetSession()->SendListInventory(creature->GetGUID()); player->GetSession()->SendListInventory(creature->GetGUID());
spellId = player->GetTeamId() ? SPELL_AURA_SHOP_G : SPELL_AURA_SHOP_S; spellId = player->GetTeamId(true) ? SPELL_AURA_SHOP_G : SPELL_AURA_SHOP_S;
creature->AI()->DoAction(ARGENT_PONY_STATE_VENDOR); creature->AI()->DoAction(ARGENT_PONY_STATE_VENDOR);
break; break;
case GOSSIP_ACTION_BANK: case GOSSIP_ACTION_BANK:
creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER);
player->GetSession()->SendShowBank(player->GetGUID()); player->GetSession()->SendShowBank(player->GetGUID());
spellId = player->GetTeamId() ? SPELL_AURA_BANK_G : SPELL_AURA_BANK_S; spellId = player->GetTeamId(true) ? SPELL_AURA_BANK_G : SPELL_AURA_BANK_S;
creature->AI()->DoAction(ARGENT_PONY_STATE_BANK); creature->AI()->DoAction(ARGENT_PONY_STATE_BANK);
break; break;
case GOSSIP_ACTION_MAILBOX: case GOSSIP_ACTION_MAILBOX:
{ {
creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP|UNIT_NPC_FLAG_MAILBOX); creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP|UNIT_NPC_FLAG_MAILBOX);
player->GetSession()->SendShowMailBox(creature->GetGUID()); player->GetSession()->SendShowMailBox(creature->GetGUID());
spellId = player->GetTeamId() ? SPELL_AURA_POSTMAN_G : SPELL_AURA_POSTMAN_S; spellId = player->GetTeamId(true) ? SPELL_AURA_POSTMAN_G : SPELL_AURA_POSTMAN_S;
creature->AI()->DoAction(ARGENT_PONY_STATE_MAILBOX); creature->AI()->DoAction(ARGENT_PONY_STATE_MAILBOX);
break; break;
} }
@@ -409,7 +409,7 @@ public:
{ {
creature->CastSpell(creature, spellId, true); creature->CastSpell(creature, spellId, true);
player->AddSpellCooldown(spellId, 0, 3*MINUTE*IN_MILLISECONDS); player->AddSpellCooldown(spellId, 0, 3*MINUTE*IN_MILLISECONDS);
player->AddSpellCooldown(player->GetTeamId() ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S, 0, 3*MINUTE*IN_MILLISECONDS + 4*HOUR*IN_MILLISECONDS); player->AddSpellCooldown(player->GetTeamId(true) ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S, 0, 3*MINUTE*IN_MILLISECONDS + 4*HOUR*IN_MILLISECONDS);
creature->DespawnOrUnsummon(3*MINUTE*IN_MILLISECONDS); creature->DespawnOrUnsummon(3*MINUTE*IN_MILLISECONDS);
} }
return true; return true;