Merge remote-tracking branch 'origin/master' into mmaps
Conflicts: src/server/game/Spells/Spell.cpp
This commit is contained in:
commit
0522e50c86
23 files changed
+210
-182
No files matched your search
@@ -467,56 +467,57 @@ public:
|
||||
cInfo->rangeattacktime = fields[29].GetUInt32();
|
||||
cInfo->unit_class = fields[30].GetUInt8();
|
||||
cInfo->unit_flags = fields[31].GetUInt32();
|
||||
cInfo->dynamicflags = fields[32].GetUInt32();
|
||||
cInfo->family = fields[33].GetUInt8();
|
||||
cInfo->trainer_type = fields[34].GetUInt8();
|
||||
cInfo->trainer_spell = fields[35].GetUInt32();
|
||||
cInfo->trainer_class = fields[36].GetUInt8();
|
||||
cInfo->trainer_race = fields[37].GetUInt8();
|
||||
cInfo->minrangedmg = fields[38].GetFloat();
|
||||
cInfo->maxrangedmg = fields[39].GetFloat();
|
||||
cInfo->rangedattackpower = fields[40].GetUInt16();
|
||||
cInfo->type = fields[41].GetUInt8();
|
||||
cInfo->type_flags = fields[42].GetUInt32();
|
||||
cInfo->lootid = fields[43].GetUInt32();
|
||||
cInfo->pickpocketLootId = fields[44].GetUInt32();
|
||||
cInfo->SkinLootId = fields[45].GetUInt32();
|
||||
cInfo->unit_flags2 = fields[32].GetUInt32();
|
||||
cInfo->dynamicflags = fields[33].GetUInt32();
|
||||
cInfo->family = fields[34].GetUInt8();
|
||||
cInfo->trainer_type = fields[35].GetUInt8();
|
||||
cInfo->trainer_spell = fields[36].GetUInt32();
|
||||
cInfo->trainer_class = fields[37].GetUInt8();
|
||||
cInfo->trainer_race = fields[38].GetUInt8();
|
||||
cInfo->minrangedmg = fields[39].GetFloat();
|
||||
cInfo->maxrangedmg = fields[40].GetFloat();
|
||||
cInfo->rangedattackpower = fields[41].GetUInt16();
|
||||
cInfo->type = fields[42].GetUInt8();
|
||||
cInfo->type_flags = fields[43].GetUInt32();
|
||||
cInfo->lootid = fields[44].GetUInt32();
|
||||
cInfo->pickpocketLootId = fields[45].GetUInt32();
|
||||
cInfo->SkinLootId = fields[46].GetUInt32();
|
||||
|
||||
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
|
||||
cInfo->resistance[i] = fields[46 + i -1].GetUInt16();
|
||||
cInfo->resistance[i] = fields[47 + i -1].GetUInt16();
|
||||
|
||||
cInfo->spells[0] = fields[52].GetUInt32();
|
||||
cInfo->spells[1] = fields[53].GetUInt32();
|
||||
cInfo->spells[2] = fields[54].GetUInt32();
|
||||
cInfo->spells[3] = fields[55].GetUInt32();
|
||||
cInfo->spells[4] = fields[56].GetUInt32();
|
||||
cInfo->spells[5] = fields[57].GetUInt32();
|
||||
cInfo->spells[6] = fields[58].GetUInt32();
|
||||
cInfo->spells[7] = fields[59].GetUInt32();
|
||||
cInfo->PetSpellDataId = fields[60].GetUInt32();
|
||||
cInfo->VehicleId = fields[61].GetUInt32();
|
||||
cInfo->mingold = fields[62].GetUInt32();
|
||||
cInfo->maxgold = fields[63].GetUInt32();
|
||||
cInfo->AIName = fields[64].GetString();
|
||||
cInfo->MovementType = fields[65].GetUInt8();
|
||||
cInfo->InhabitType = fields[66].GetUInt8();
|
||||
cInfo->HoverHeight = fields[67].GetFloat();
|
||||
cInfo->ModHealth = fields[68].GetFloat();
|
||||
cInfo->ModMana = fields[69].GetFloat();
|
||||
cInfo->ModArmor = fields[70].GetFloat();
|
||||
cInfo->RacialLeader = fields[71].GetBool();
|
||||
cInfo->questItems[0] = fields[72].GetUInt32();
|
||||
cInfo->questItems[1] = fields[73].GetUInt32();
|
||||
cInfo->questItems[2] = fields[74].GetUInt32();
|
||||
cInfo->questItems[3] = fields[75].GetUInt32();
|
||||
cInfo->questItems[4] = fields[76].GetUInt32();
|
||||
cInfo->questItems[5] = fields[77].GetUInt32();
|
||||
cInfo->movementId = fields[78].GetUInt32();
|
||||
cInfo->RegenHealth = fields[79].GetBool();
|
||||
cInfo->equipmentId = fields[80].GetUInt32();
|
||||
cInfo->MechanicImmuneMask = fields[81].GetUInt32();
|
||||
cInfo->flags_extra = fields[82].GetUInt32();
|
||||
cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString());
|
||||
cInfo->spells[0] = fields[53].GetUInt32();
|
||||
cInfo->spells[1] = fields[54].GetUInt32();
|
||||
cInfo->spells[2] = fields[55].GetUInt32();
|
||||
cInfo->spells[3] = fields[56].GetUInt32();
|
||||
cInfo->spells[4] = fields[57].GetUInt32();
|
||||
cInfo->spells[5] = fields[58].GetUInt32();
|
||||
cInfo->spells[6] = fields[59].GetUInt32();
|
||||
cInfo->spells[7] = fields[60].GetUInt32();
|
||||
cInfo->PetSpellDataId = fields[61].GetUInt32();
|
||||
cInfo->VehicleId = fields[62].GetUInt32();
|
||||
cInfo->mingold = fields[63].GetUInt32();
|
||||
cInfo->maxgold = fields[64].GetUInt32();
|
||||
cInfo->AIName = fields[65].GetString();
|
||||
cInfo->MovementType = fields[66].GetUInt8();
|
||||
cInfo->InhabitType = fields[67].GetUInt8();
|
||||
cInfo->HoverHeight = fields[68].GetFloat();
|
||||
cInfo->ModHealth = fields[69].GetFloat();
|
||||
cInfo->ModMana = fields[70].GetFloat();
|
||||
cInfo->ModArmor = fields[71].GetFloat();
|
||||
cInfo->RacialLeader = fields[72].GetBool();
|
||||
cInfo->questItems[0] = fields[73].GetUInt32();
|
||||
cInfo->questItems[1] = fields[74].GetUInt32();
|
||||
cInfo->questItems[2] = fields[75].GetUInt32();
|
||||
cInfo->questItems[3] = fields[76].GetUInt32();
|
||||
cInfo->questItems[4] = fields[77].GetUInt32();
|
||||
cInfo->questItems[5] = fields[78].GetUInt32();
|
||||
cInfo->movementId = fields[79].GetUInt32();
|
||||
cInfo->RegenHealth = fields[80].GetBool();
|
||||
cInfo->equipmentId = fields[81].GetUInt32();
|
||||
cInfo->MechanicImmuneMask = fields[82].GetUInt32();
|
||||
cInfo->flags_extra = fields[83].GetUInt32();
|
||||
cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString());
|
||||
|
||||
sObjectMgr->CheckCreatureTemplate(cInfo);
|
||||
}
|
||||
|
||||
@@ -228,13 +228,13 @@ class boss_ick : public CreatureScript
|
||||
case EVENT_TOXIC_WASTE:
|
||||
if (Creature* krick = GetKrick())
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
krick->CastSpell(target, SPELL_TOXIC_WASTE, false);
|
||||
krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
|
||||
break;
|
||||
case EVENT_SHADOW_BOLT:
|
||||
if (Creature* krick = GetKrick())
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
krick->CastSpell(target, SPELL_SHADOW_BOLT, false);
|
||||
krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
|
||||
return;
|
||||
case EVENT_MIGHTY_KICK:
|
||||
|
||||
@@ -782,10 +782,13 @@ struct violet_hold_trashAI : public npc_escortAI
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Creature* portal = Unit::GetCreature((*me), instance->GetData64(DATA_TELEPORTATION_PORTAL)))
|
||||
CAST_AI(npc_teleportation_portal_vh::npc_teleportation_portalAI, portal->AI())->SummonedMobDied(me);
|
||||
if (instance)
|
||||
{
|
||||
if (Creature* portal = Unit::GetCreature((*me), instance->GetData64(DATA_TELEPORTATION_PORTAL)))
|
||||
CAST_AI(npc_teleportation_portal_vh::npc_teleportation_portalAI, portal->AI())->SummonedMobDied(me);
|
||||
|
||||
instance->SetData(DATA_NPC_PRESENCE_AT_DOOR_REMOVE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void CreatureStartAttackDoor()
|
||||
|
||||
@@ -839,19 +839,10 @@ public:
|
||||
return 1500;
|
||||
break;
|
||||
case 16:
|
||||
if (player)
|
||||
{
|
||||
Illi->CastSpell(player, SPELL_TWO, true);
|
||||
player->RemoveAurasDueToSpell(SPELL_THREE);
|
||||
player->RemoveAurasDueToSpell(SPELL_FOUR);
|
||||
return 5000;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE);
|
||||
Step = 30;
|
||||
return 100;
|
||||
}
|
||||
Illi->CastSpell(player, SPELL_TWO, true);
|
||||
player->RemoveAurasDueToSpell(SPELL_THREE);
|
||||
player->RemoveAurasDueToSpell(SPELL_FOUR);
|
||||
return 5000;
|
||||
break;
|
||||
case 17:
|
||||
DoScriptText(LORD_ILLIDAN_SAY_5, Illi);
|
||||
@@ -1871,8 +1862,8 @@ public:
|
||||
|
||||
enum ZuluhedChains
|
||||
{
|
||||
QUEST_ZULUHED = 10866,
|
||||
NPC_KARYNAKU = 22112,
|
||||
QUEST_ZULUHED = 10866,
|
||||
NPC_KARYNAKU = 22112,
|
||||
};
|
||||
|
||||
class spell_unlocking_zuluheds_chains : public SpellScriptLoader
|
||||
@@ -1884,18 +1875,21 @@ class spell_unlocking_zuluheds_chains : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_unlocking_zuluheds_chains_SpellScript);
|
||||
|
||||
void HandleOnCast()
|
||||
bool Load()
|
||||
{
|
||||
// FIXME: Hackish solution, a better way to reward killcredit should be found
|
||||
if (Unit* caster = GetCaster())
|
||||
if(Player* player = caster->ToPlayer())
|
||||
if (player->GetQuestStatus(QUEST_ZULUHED) == QUEST_STATUS_INCOMPLETE)
|
||||
player->CastedCreatureOrGO(NPC_KARYNAKU, MAKE_NEW_GUID(0, NPC_KARYNAKU, HIGHGUID_UNIT), 0);
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void HandleAfterHit()
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
if (caster->GetQuestStatus(QUEST_ZULUHED) == QUEST_STATUS_INCOMPLETE)
|
||||
caster->KilledMonsterCredit(NPC_KARYNAKU, 0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCast += SpellCastFn(spell_unlocking_zuluheds_chains_SpellScript::HandleOnCast);
|
||||
AfterHit += SpellHitFn(spell_unlocking_zuluheds_chains_SpellScript::HandleAfterHit);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -907,9 +907,22 @@ class spell_gen_profession_research : public SpellScriptLoader
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
uint32 spellId = GetSpellInfo()->Id;
|
||||
|
||||
// learn random explicit discovery recipe (if any)
|
||||
if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster->ToPlayer()))
|
||||
caster->learnSpell(discoveredSpellId, false);
|
||||
|
||||
caster->UpdateCraftSkill(spellId);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_gen_profession_research_SpellScript::CheckRequirement);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_profession_research_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -836,9 +836,20 @@ class spell_item_book_of_glyph_mastery : public SpellScriptLoader
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* caster = GetCaster()->ToPlayer();
|
||||
uint32 spellId = GetSpellInfo()->Id;
|
||||
|
||||
// learn random explicit discovery recipe (if any)
|
||||
if (uint32 discoveredSpellId = GetExplicitDiscoverySpell(spellId, caster->ToPlayer()))
|
||||
caster->learnSpell(discoveredSpellId, false);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_book_of_glyph_mastery_SpellScript::CheckRequirement);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_book_of_glyph_mastery_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user