Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Handlers/QuestHandler.cpp
	src/server/game/Spells/SpellInfo.h
	src/server/game/World/World.cpp
This commit is contained in:
Vincent_Michael
2013-12-15 03:47:21 +01:00
56 changed files with 455 additions and 117 deletions

View File

@@ -92,7 +92,7 @@ public:
// ok, normal (creature/GO starting) quest
if (player->CanAddQuest(quest, true))
{
player->AddQuest(quest, NULL);
player->AddQuestAndCheckCompletion(quest, NULL);
if (player->CanCompleteQuest(entry))
player->CompleteQuest(entry);

View File

@@ -163,7 +163,8 @@ public:
## npc_brunnhildar_prisoner
######*/
enum BrunnhildarPrisoner {
enum BrunnhildarPrisoner
{
SPELL_ICE_PRISON = 54894,
SPELL_ICE_LANCE = 55046,
SPELL_FREE_PRISONER = 55048,
@@ -635,14 +636,13 @@ class spell_close_rift : public SpellScriptLoader
};
/*#####
# spell_jokkum_scriptcast
# Krolmir, Hammer of Storms
#####*/
enum JokkumScriptcast
{
SPELL_JOKKUM_KILL_CREDIT = 56545,
SPELL_JOKKUM_SUMMON = 56541,
SPELL_RIDE_JOKKUM = 56606,
NPC_KINGJOKKUM = 30331,
SAY_HOLD_ON = 0,
PATH_JOKKUM = 2072200
@@ -658,29 +658,15 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_KILL_CREDIT) || !sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
return false;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetTarget()->ToPlayer())
{
player->CastSpell(player, SPELL_JOKKUM_KILL_CREDIT, true);
player->CastSpell(player, SPELL_JOKKUM_SUMMON, true);
if (Creature* kingjokkum = GetClosestCreatureWithEntry(player, NPC_KINGJOKKUM, 10.0f))
{
kingjokkum->setFaction(player->getFaction());
player->CastSpell(kingjokkum, SPELL_RIDE_JOKKUM, true);
player->SetUInt64Value(PLAYER_FARSIGHT, player->GetGUID());
kingjokkum->AI()->Talk(0, player->GetGUID());
kingjokkum->ToPlayer()->SetClientControl(kingjokkum, 1);
kingjokkum->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
kingjokkum->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
}
}
Unit* target = GetTarget();
target->CastSpell(target, SPELL_JOKKUM_SUMMON, true);
}
void Register() OVERRIDE
@@ -695,6 +681,45 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
}
};
class npc_king_jokkum_vehicle : public CreatureScript
{
public:
npc_king_jokkum_vehicle() : CreatureScript("npc_king_jokkum_vehicle") { }
struct npc_king_jokkum_vehicleAI : public VehicleAI
{
npc_king_jokkum_vehicleAI(Creature* creature) : VehicleAI(creature) { }
void OnCharmed(bool /*apply*/) OVERRIDE { }
void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) OVERRIDE
{
if (apply)
{
Talk(SAY_HOLD_ON, who->GetGUID());
me->CastSpell(who, SPELL_JOKKUM_KILL_CREDIT, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
me->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
}
}
void MovementInform(uint32 type, uint32 id) OVERRIDE
{
if (type != WAYPOINT_MOTION_TYPE)
return;
// PointId in WaypointMovementGenerator doesn't match with PointId in DB
if (id == 19)
me->GetVehicleKit()->RemoveAllPassengers();
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_king_jokkum_vehicleAI(creature);
}
};
void AddSC_storm_peaks()
{
new npc_injured_goblin();
@@ -706,4 +731,5 @@ void AddSC_storm_peaks()
new npc_brann_bronzebeard_keystone();
new spell_close_rift();
new spell_jokkum_scriptcast();
new npc_king_jokkum_vehicle();
}