diff options
Diffstat (limited to 'src/server/scripts')
61 files changed, 358 insertions, 8405 deletions
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index f5fbfa33cae..87948391500 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -275,7 +275,7 @@ public: if (titleInfo && target->HasTitle(titleInfo)) { - std::string name = titleInfo->name[loc]; + std::string name = titleInfo->name; if (name.empty()) continue; @@ -471,7 +471,7 @@ public: { FactionState const& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; + char const* factionName = factionEntry ? factionEntry->name : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]); std::ostringstream ss; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 7f25a11bcdd..67b4d780942 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -236,7 +236,7 @@ public: return false; SellResult msg = SellResult(atoi(args)); - handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0, 0); + handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0); return true; } @@ -310,7 +310,7 @@ public: uint32 opcode; parsedStream >> opcode; - WorldPacket data(opcode, 0); + WorldPacket data(Opcodes(opcode), 0); while (!parsedStream.eof()) { @@ -416,7 +416,7 @@ public: } sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode()); data.hexlike(); - player->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data, true); handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName()); return true; } @@ -1325,7 +1325,7 @@ public: { Player* player = handler->GetSession()->GetPlayer(); - sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + sLog->outInfo(LOG_FILTER_SQL_DEV, "(@PATH, XX, %.3f, %.3f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); return true; diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index a2a80edd43b..0bb376b08dd 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -62,7 +62,7 @@ public: { "add", SEC_ADMINISTRATOR, true, NULL, "", addDisableCommandTable }, { "remove", SEC_ADMINISTRATOR, true, NULL, "", removeDisableCommandTable }, { NULL, 0, false, NULL, "", NULL } - }; + }; static ChatCommand commandTable[] = { { "disable", SEC_ADMINISTRATOR, false, NULL, "", disableCommandTable }, @@ -88,7 +88,7 @@ public: uint32 entry = uint32(atoi(entryStr)); std::string disableTypeStr = ""; - + switch (disableType) { case DISABLE_TYPE_SPELL: @@ -171,12 +171,12 @@ public: default: break; } - + PreparedStatement* stmt = NULL; stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES); stmt->setUInt32(0, entry); - stmt->setUInt8(1, disableType); - PreparedQueryResult result = WorldDatabase.Query(stmt); + stmt->setUInt8(1, disableType); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { handler->PSendSysMessage("This %s (Id: %u) is already disabled.", disableTypeStr.c_str(), entry); @@ -290,8 +290,8 @@ public: PreparedStatement* stmt = NULL; stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES); stmt->setUInt32(0, entry); - stmt->setUInt8(1, disableType); - PreparedQueryResult result = WorldDatabase.Query(stmt); + stmt->setUInt8(1, disableType); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { handler->PSendSysMessage("This %s (Id: %u) is not disabled.", disableTypeStr.c_str(), entry); diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 3dfc6f9c7e8..0230ebcd1e7 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -96,19 +96,16 @@ public: if (!target) target = handler->GetSession()->GetPlayer(); - WorldPacket data(12); + WorldPacket data; if (strncmp(args, "on", 3) == 0) - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + target->SendMovementSetCanFly(true); else if (strncmp(args, "off", 4) == 0) - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + target->SendMovementSetCanFly(false); else { handler->SendSysMessage(LANG_USE_BOL); return false; } - data.append(target->GetPackGUID()); - data << uint32(0); // unknown - target->SendMessageToSet(&data, true); handler->PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, handler->GetNameLink(target).c_str(), args); return true; } diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 5c16a0963d3..5a0fd28e81a 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -435,7 +435,7 @@ public: AuraApplication const* aurApp = itr->second; Aura const* aura = aurApp->GetBase(); - char const* name = aura->GetSpellInfo()->SpellName[handler->GetSessionDbcLocale()]; + char const* name = aura->GetSpellInfo()->SpellName; std::ostringstream ss_name; ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r"; diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 951ebc7714b..3a2ef366ace 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -94,48 +94,30 @@ public: AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag); if (areaEntry) { - int locale = handler->GetSessionDbcLocale(); - std::string name = areaEntry->area_name[locale]; + std::string name = areaEntry->area_name; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = areaEntry->area_name[locale]; - if (name.empty()) - continue; - - if (Utf8FitTo(name, wNamePart)) - break; - } - } + continue; - if (locale < TOTAL_LOCALES) + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - // send area in "id - [name]" format - std::ostringstream ss; - if (handler->GetSession()) - ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name << ' ' << localeNames[locale]<< "]|h|r"; - else - ss << areaEntry->ID << " - " << name << ' ' << localeNames[locale]; + // send area in "id - [name]" format + std::ostringstream ss; + if (handler->GetSession()) + ss << areaEntry->ID << " - |cffffffff|Harea:" << areaEntry->ID << "|h[" << name<< "]|h|r"; + else + ss << areaEntry->ID << " - " << name; - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str().c_str()); - if (!found) - found = true; - } + if (!found) + found = true; } } @@ -301,77 +283,58 @@ public: for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id) { - FactionEntry const* factionEntry = sFactionStore.LookupEntry(id); - if (factionEntry) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(id)) { FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL; - int locale = handler->GetSessionDbcLocale(); - std::string name = factionEntry->name[locale]; + std::string name = factionEntry->name; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = factionEntry->name[locale]; - if (name.empty()) - continue; - - if (Utf8FitTo(name, wNamePart)) - break; - } - } + continue; - if (locale < TOTAL_LOCALES) + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format - // or "id - [faction] [no reputation]" format - std::ostringstream ss; - if (handler->GetSession()) - ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << ' ' << localeNames[locale] << "]|h|r"; - else - ss << id << " - " << name << ' ' << localeNames[locale]; + // send faction in "id - [faction] rank reputation [visible] [at war] [own team] [unknown] [invisible] [inactive]" format + // or "id - [faction] [no reputation]" format + std::ostringstream ss; + if (handler->GetSession()) + ss << id << " - |cffffffff|Hfaction:" << id << "|h[" << name << "]|h|r"; + else + ss << id << " - " << name; - if (factionState) // and then target != NULL also - { - uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry); - std::string rankName = handler->GetTrinityString(index); - - ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; - - if (factionState->Flags & FACTION_FLAG_VISIBLE) - ss << handler->GetTrinityString(LANG_FACTION_VISIBLE); - if (factionState->Flags & FACTION_FLAG_AT_WAR) - ss << handler->GetTrinityString(LANG_FACTION_ATWAR); - if (factionState->Flags & FACTION_FLAG_PEACE_FORCED) - ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED); - if (factionState->Flags & FACTION_FLAG_HIDDEN) - ss << handler->GetTrinityString(LANG_FACTION_HIDDEN); - if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED) - ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); - if (factionState->Flags & FACTION_FLAG_INACTIVE) - ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); - } - else - ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION); + if (factionState) // and then target != NULL also + { + uint32 index = target->GetReputationMgr().GetReputationRankStrIndex(factionEntry); + std::string rankName = handler->GetTrinityString(index); + + ss << ' ' << rankName << "|h|r (" << target->GetReputationMgr().GetReputation(factionEntry) << ')'; + + if (factionState->Flags & FACTION_FLAG_VISIBLE) + ss << handler->GetTrinityString(LANG_FACTION_VISIBLE); + if (factionState->Flags & FACTION_FLAG_AT_WAR) + ss << handler->GetTrinityString(LANG_FACTION_ATWAR); + if (factionState->Flags & FACTION_FLAG_PEACE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED); + if (factionState->Flags & FACTION_FLAG_HIDDEN) + ss << handler->GetTrinityString(LANG_FACTION_HIDDEN); + if (factionState->Flags & FACTION_FLAG_INVISIBLE_FORCED) + ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED); + if (factionState->Flags & FACTION_FLAG_INACTIVE) + ss << handler->GetTrinityString(LANG_FACTION_INACTIVE); + } + else + ss << handler->GetTrinityString(LANG_FACTION_NOREPUTATION); - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str().c_str()); - if (!found) - found = true; - } + if (!found) + found = true; } } @@ -486,45 +449,27 @@ public: ItemSetEntry const* set = sItemSetStore.LookupEntry(id); if (set) { - int locale = handler->GetSessionDbcLocale(); - std::string name = set->name[locale]; + std::string name = set->name; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = set->name[locale]; - if (name.empty()) - continue; - - if (Utf8FitTo(name, wNamePart)) - break; - } - } + continue; - if (locale < TOTAL_LOCALES) + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - // send item set in "id - [namedlink locale]" format - if (handler->GetSession()) - handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), localeNames[locale]); - else - handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), localeNames[locale]); + // send item set in "id - [namedlink locale]" format + if (handler->GetSession()) + handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), ""); + else + handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), ""); - if (!found) - found = true; - } + if (!found) + found = true; } } if (!found) @@ -767,59 +712,41 @@ public: SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id); if (skillInfo) { - int locale = handler->GetSessionDbcLocale(); - std::string name = skillInfo->name[locale]; + std::string name = skillInfo->name; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = skillInfo->name[locale]; - if (name.empty()) - continue; + continue; - if (Utf8FitTo(name, wNamePart)) - break; - } + if (maxResults && count++ == maxResults) + { + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; } - if (locale < TOTAL_LOCALES) + char valStr[50] = ""; + char const* knownStr = ""; + if (target && target->HasSkill(id)) { - if (maxResults && count++ == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } - - char valStr[50] = ""; - char const* knownStr = ""; - if (target && target->HasSkill(id)) - { - knownStr = handler->GetTrinityString(LANG_KNOWN); - uint32 curValue = target->GetPureSkillValue(id); - uint32 maxValue = target->GetPureMaxSkillValue(id); - uint32 permValue = target->GetSkillPermBonusValue(id); - uint32 tempValue = target->GetSkillTempBonusValue(id); - - char const* valFormat = handler->GetTrinityString(LANG_SKILL_VALUES); - snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue); - } + knownStr = handler->GetTrinityString(LANG_KNOWN); + uint32 curValue = target->GetPureSkillValue(id); + uint32 maxValue = target->GetPureMaxSkillValue(id); + uint32 permValue = target->GetSkillPermBonusValue(id); + uint32 tempValue = target->GetSkillTempBonusValue(id); + + char const* valFormat = handler->GetTrinityString(LANG_SKILL_VALUES); + snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue); + } - // send skill in "id - [namedlink locale]" format - if (handler->GetSession()) - handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), localeNames[locale], knownStr, valStr); - else - handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), localeNames[locale], knownStr, valStr); + // send skill in "id - [namedlink locale]" format + if (handler->GetSession()) + handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), "", knownStr, valStr); + else + handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), "", knownStr, valStr); - if (!found) - found = true; - } + if (!found) + found = true; } } if (!found) @@ -855,83 +782,63 @@ public: SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id); if (spellInfo) { - int locale = handler->GetSessionDbcLocale(); - std::string name = spellInfo->SpellName[locale]; + std::string name = spellInfo->SpellName; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = spellInfo->SpellName[locale]; - if (name.empty()) - continue; - - if (Utf8FitTo(name, wNamePart)) - break; - } - } + continue; - if (locale < TOTAL_LOCALES) + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - bool known = target && target->HasSpell(id); - bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL); + bool known = target && target->HasSpell(id); + bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL); - SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell); + SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell); - uint32 talentCost = GetTalentSpellCost(id); + uint32 talentCost = GetTalentSpellCost(id); - bool talent = (talentCost > 0); - bool passive = spellInfo->IsPassive(); - bool active = target && target->HasAura(id); + bool talent = (talentCost > 0); + bool passive = spellInfo->IsPassive(); + bool active = target && target->HasAura(id); - // unit32 used to prevent interpreting uint8 as char at output - // find rank of learned spell for learning spell, or talent rank - uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank(); + // unit32 used to prevent interpreting uint8 as char at output + // find rank of learned spell for learning spell, or talent rank + uint32 rank = talentCost ? talentCost : learn && learnSpellInfo ? learnSpellInfo->GetRank() : spellInfo->GetRank(); - // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format - std::ostringstream ss; - if (handler->GetSession()) - ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name; - else - ss << id << " - " << name; + // send spell in "id - [name, rank N] [talent] [passive] [learn] [known]" format + std::ostringstream ss; + if (handler->GetSession()) + ss << id << " - |cffffffff|Hspell:" << id << "|h[" << name; + else + ss << id << " - " << name; - // include rank in link name - if (rank) - ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank; + // include rank in link name + if (rank) + ss << handler->GetTrinityString(LANG_SPELL_RANK) << rank; - if (handler->GetSession()) - ss << ' ' << localeNames[locale] << "]|h|r"; - else - ss << ' ' << localeNames[locale]; + if (handler->GetSession()) + ss << "]|h|r"; - if (talent) - ss << handler->GetTrinityString(LANG_TALENT); - if (passive) - ss << handler->GetTrinityString(LANG_PASSIVE); - if (learn) - ss << handler->GetTrinityString(LANG_LEARN); - if (known) - ss << handler->GetTrinityString(LANG_KNOWN); - if (active) - ss << handler->GetTrinityString(LANG_ACTIVE); + if (talent) + ss << handler->GetTrinityString(LANG_TALENT); + if (passive) + ss << handler->GetTrinityString(LANG_PASSIVE); + if (learn) + ss << handler->GetTrinityString(LANG_LEARN); + if (known) + ss << handler->GetTrinityString(LANG_KNOWN); + if (active) + ss << handler->GetTrinityString(LANG_ACTIVE); - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str().c_str()); - if (!found) - found = true; - } + if (!found) + found = true; } } if (!found) @@ -964,47 +871,29 @@ public: TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id); if (nodeEntry) { - int locale = handler->GetSessionDbcLocale(); - std::string name = nodeEntry->name[locale]; + std::string name = nodeEntry->name; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = nodeEntry->name[locale]; - if (name.empty()) - continue; - - if (Utf8FitTo(name, wNamePart)) - break; - } - } + continue; - if (locale < TOTAL_LOCALES) + if (maxResults && count++ == maxResults) { - if (maxResults && count++ == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format - if (handler->GetSession()) - handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[locale], - nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); - else - handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[locale], - nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); + // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format + if (handler->GetSession()) + handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), "", + nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); + else + handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), "", + nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); - if (!found) - found = true; - } + if (!found) + found = true; } } if (!found) @@ -1101,53 +990,35 @@ public: CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); if (titleInfo) { - int locale = handler->GetSessionDbcLocale(); - std::string name = titleInfo->name[locale]; + std::string name = titleInfo->name; if (name.empty()) continue; if (!Utf8FitTo(name, wNamePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = titleInfo->name[locale]; - if (name.empty()) - continue; - - if (Utf8FitTo(name, wNamePart)) - break; - } - } + continue; - if (locale < TOTAL_LOCALES) + if (maxResults && counter == maxResults) { - if (maxResults && counter == maxResults) - { - handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); - return true; - } + handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); + return true; + } - char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : ""; + char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : ""; - char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index - ? handler->GetTrinityString(LANG_ACTIVE) - : ""; + char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + ? handler->GetTrinityString(LANG_ACTIVE) + : ""; - char titleNameStr[80]; - snprintf(titleNameStr, 80, name.c_str(), targetName); + char titleNameStr[80]; + snprintf(titleNameStr, 80, name.c_str(), targetName); - // send title in "id (idx:idx) - [namedlink locale]" format - if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[locale], knownStr, activeStr); - else - handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[locale], knownStr, activeStr); + // send title in "id (idx:idx) - [namedlink locale]" format + if (handler->GetSession()) + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, "", knownStr, activeStr); + else + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, "", knownStr, activeStr); - ++counter; - } + ++counter; } } if (counter == 0) // if counter == 0 then we found nth diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 80847d7dec4..d8026ccd10a 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -220,9 +220,9 @@ public: handler->PSendSysMessage("no VMAP available for area info");
handler->PSendSysMessage(LANG_MAP_POSITION,
- object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : "<unknown>"),
- zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
- areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : "<unknown>"),
+ object->GetMapId(), (mapEntry ? mapEntry->name : "<unknown>"),
+ zoneId, (zoneEntry ? zoneEntry->area_name : "<unknown>"),
+ areaId, (areaEntry ? areaEntry->area_name : "<unknown>"),
object->GetPhaseMask(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
@@ -2212,9 +2212,9 @@ public: return false;
if (strncmp(args, "on", 3) == 0)
- player->SetMovement(MOVE_WATER_WALK); // ON
+ player->SendMovementSetWaterWalking(true);
else if (strncmp(args, "off", 4) == 0)
- player->SetMovement(MOVE_LAND_WALK); // OFF
+ player->SendMovementSetWaterWalking(false);
else
{
handler->SendSysMessage(LANG_USE_BOL);
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index a88c765c596..dee8a52debd 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ObjectMgr.h" #include "Chat.h" +#include <stdlib.h> class modify_commandscript : public CommandScript { @@ -968,14 +969,14 @@ public: target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP); target->Mount(mId); - WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4)); + WorldPacket data(SMSG_MOVE_SET_RUN_SPEED, (8+4+1+4)); data.append(target->GetPackGUID()); data << (uint32)0; data << (uint8)0; //new 2.1.0 data << float(speed); target->SendMessageToSet(&data, true); - data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8+4+4)); + data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, (8+4+4)); data.append(target->GetPackGUID()); data << (uint32)0; data << float(speed); @@ -1004,11 +1005,11 @@ public: int32 addmoney = atoi((char*)args); - uint32 moneyuser = target->GetMoney(); + uint64 moneyuser = target->GetMoney(); if (addmoney < 0) { - int32 newmoney = int32(moneyuser) + addmoney; + int64 newmoney = int32(moneyuser) + addmoney; sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney); if (newmoney <= 0) @@ -1032,18 +1033,17 @@ public: } else { - handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, uint32(addmoney), handler->GetNameLink(target).c_str()); if (handler->needReportToTarget(target)) - (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), addmoney); + (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), uint32(addmoney)); if (addmoney >=MAX_MONEY_AMOUNT) target->SetMoney(MAX_MONEY_AMOUNT); else - target->ModifyMoney(addmoney); + target->ModifyMoney(int64(addmoney)); } - sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, target->GetMoney()); - + sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, uint32(addmoney), target->GetMoney()); return true; } @@ -1102,7 +1102,7 @@ public: return true; } - static bool HandleModifyHonorCommand (ChatHandler* handler, const char* args) + static bool HandleModifyHonorCommand(ChatHandler* handler, const char* args) { if (!*args) return false; @@ -1121,9 +1121,9 @@ public: int32 amount = (uint32)atoi(args); - target->ModifyHonorPoints(amount); + target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetHonorPoints()); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); return true; } @@ -1237,7 +1237,7 @@ public: } target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, + handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; } @@ -1311,9 +1311,9 @@ public: int32 amount = (uint32)atoi(args); - target->ModifyArenaPoints(amount); + target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetArenaPoints()); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); return true; } diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 3bb29f8abfe..40b36fb8d52 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -102,7 +102,6 @@ public: { "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, { "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "", NULL }, { "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "", NULL }, - { "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "", NULL }, { "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL }, { "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, { "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL }, @@ -110,7 +109,6 @@ public: { "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, { "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, { "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL }, - { "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "", NULL }, { "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "", NULL }, { "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "", NULL }, { "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL }, @@ -503,20 +501,21 @@ public: 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->ModManaExtra = 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); } @@ -946,14 +945,6 @@ public: return true; } - static bool HandleReloadItemSetNamesCommand(ChatHandler* handler, const char* /*args*/) - { - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Item set names..."); - sObjectMgr->LoadItemSetNames(); - handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded."); - return true; - } - static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) @@ -1208,14 +1199,6 @@ public: return true; } - static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/) - { - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales Item set name... "); - sObjectMgr->LoadItemSetNameLocales(); - handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded."); - return true; - } - static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/) { sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Locales NPC Text ... "); diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 82fb409faa7..b0bf3e03f58 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -62,7 +62,7 @@ public: if (target) target->GetAchievementMgr().Reset(); else - AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid)); + AchievementMgr<Player>::DeleteFromDB(GUID_LOPART(targetGuid)); return true; } @@ -73,11 +73,8 @@ public: if (!handler->extractPlayerTarget((char*)args, &target)) return false; - target->SetHonorPoints(0); target->SetUInt32Value(PLAYER_FIELD_KILLS, 0); target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); - target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); - target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0); target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); return true; @@ -234,7 +231,7 @@ public: if (target) { - target->resetTalents(true); + target->ResetTalents(true); target->SendTalentsInfoData(false); ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index f35f6baca98..0a3b430ab2c 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -138,7 +138,7 @@ public: char const* targetName = target->GetName(); char titleNameStr[80]; - snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName); + snprintf(titleNameStr, 80, titleInfo->name, targetName); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str()); @@ -187,7 +187,7 @@ public: char const* targetName = target->GetName(); char titleNameStr[80]; - snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName); + snprintf(titleNameStr, 80, titleInfo->name, targetName); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str()); diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 5dc3b52dec1..de3e6ae32a6 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -32,7 +32,6 @@ set(scripts_STAT_SRCS EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp EasternKingdoms/isle_of_queldanas.cpp - EasternKingdoms/boss_kruul.cpp EasternKingdoms/ZulGurub/boss_hakkar.cpp EasternKingdoms/ZulGurub/boss_mandokir.cpp EasternKingdoms/ZulGurub/boss_marli.cpp diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 8e0fb9ff411..c2dab8d6c9e 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -237,7 +237,7 @@ class instance_deadmines : public InstanceMapScript void DoPlaySound(GameObject* unit, uint32 sound) { - WorldPacket data(4); + WorldPacket data; data.SetOpcode(SMSG_PLAY_SOUND); data << uint32(sound); unit->SendMessageToSet(&data, false); @@ -245,7 +245,7 @@ class instance_deadmines : public InstanceMapScript void DoPlaySoundCreature(Unit* unit, uint32 sound) { - WorldPacket data(4); + WorldPacket data; data.SetOpcode(SMSG_PLAY_SOUND); data << uint32(sound); unit->SendMessageToSet(&data, false); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index bd79cbba628..d1b0e076d9c 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -246,8 +246,7 @@ public: // Also needs an exception in spell system. unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID()); // Use packet hack - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); @@ -266,8 +265,7 @@ public: unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 028cf640d21..61df92c18e2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -434,7 +434,7 @@ public: { me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); me->SetSpeed(MOVE_WALK, 5.0f, true); wp_reached = false; count = 0; @@ -467,7 +467,7 @@ public: instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject break; case 19: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); break; case 20: { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 167f040bbc4..5ca685393ae 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -265,7 +265,7 @@ public: { OrbsEmpowered = 0; EmpowerCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->setActive(true); @@ -453,7 +453,7 @@ public: summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false); break; case CREATURE_ANVEENA: - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + summoned->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index b0d59fe8b5a..9db03971756 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -47,8 +47,12 @@ enum eEnums SAY_PROGRESS_7 = 7, EMOTE_PROGRESS_8 = 8, SAY_PROGRESS_9 = 9, + + EVENT_SAY_3 = 1, + EVENT_SAY_6 = 2, + EVENT_SAY_8 = 3, - QUEST_SUNKEN_TREASURE = 665, + QUEST_GOGGLE_BOGGLE = 26050, MOB_VENGEFUL_SURGE = 2776 }; @@ -73,33 +77,22 @@ class npc_professor_phizzlethorpe : public CreatureScript switch (waypointId) { - case 4: + case 6: Talk(SAY_PROGRESS_2, player->GetGUID()); - break; - case 5: - Talk(SAY_PROGRESS_3, player->GetGUID()); + events.ScheduleEvent(EVENT_SAY_3, 3000); break; case 8: Talk(EMOTE_PROGRESS_4); - break; - case 9: - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - case 10: - Talk(SAY_PROGRESS_5, player->GetGUID()); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2065.505f, -2136.88f, 22.20362f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2059.249f, -2134.88f, 21.51582f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); break; case 11: - Talk(SAY_PROGRESS_6, player->GetGUID()); - SetRun(); + Talk(SAY_PROGRESS_5, player->GetGUID()); + events.ScheduleEvent(EVENT_SAY_6, 11000); break; - case 19: + case 17: Talk(SAY_PROGRESS_7, player->GetGUID()); - break; - case 20: - Talk(EMOTE_PROGRESS_8); - Talk(SAY_PROGRESS_9, player->GetGUID()); - player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + events.ScheduleEvent(EVENT_SAY_8, 6000); break; } } @@ -116,8 +109,34 @@ class npc_professor_phizzlethorpe : public CreatureScript void UpdateAI(const uint32 diff) { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + events.Update(diff); + + while (uint32 event = events.ExecuteEvent()) + { + switch (event) + { + case EVENT_SAY_3: + Talk(SAY_PROGRESS_3, player->GetGUID()); + break; + case EVENT_SAY_6: + Talk(SAY_PROGRESS_6, player->GetGUID()); + SetRun(); + break; + case EVENT_SAY_8: + Talk(EMOTE_PROGRESS_8); + Talk(SAY_PROGRESS_9, player->GetGUID()); + player->GroupEventHappens(QUEST_GOGGLE_BOGGLE, me); + break; + } + } npc_escortAI::UpdateAI(diff); } + + EventMap events; }; CreatureAI* GetAI(Creature* creature) const @@ -127,13 +146,13 @@ class npc_professor_phizzlethorpe : public CreatureScript bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) + if (quest->GetQuestId() == QUEST_GOGGLE_BOGGLE) { creature->AI()->Talk(SAY_PROGRESS_1, player->GetGUID()); if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI()))) pEscortAI->Start(false, false, player->GetGUID(), quest); - creature->setFaction(113); + creature->setFaction(42); } return true; } diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp deleted file mode 100644 index 6a1ba633660..00000000000 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Boss_Kruul -SD%Complete: 100 -SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back. -SDCategory: Bosses -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -#define SPELL_SHADOWVOLLEY 21341 -#define SPELL_CLEAVE 20677 -#define SPELL_THUNDERCLAP 23931 -#define SPELL_TWISTEDREFLECTION 21063 -#define SPELL_VOIDBOLT 21066 -#define SPELL_RAGE 21340 -#define SPELL_CAPTURESOUL 21054 - -class boss_kruul : public CreatureScript -{ -public: - boss_kruul() : CreatureScript("boss_kruul") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_kruulAI (creature); - } - - struct boss_kruulAI : public ScriptedAI - { - boss_kruulAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ShadowVolley_Timer; - uint32 Cleave_Timer; - uint32 ThunderClap_Timer; - uint32 TwistedReflection_Timer; - uint32 VoidBolt_Timer; - uint32 Rage_Timer; - uint32 Hound_Timer; - - void Reset() - { - ShadowVolley_Timer = 10000; - Cleave_Timer = 14000; - ThunderClap_Timer = 20000; - TwistedReflection_Timer = 25000; - VoidBolt_Timer = 30000; - Rage_Timer = 60000; //Cast rage after 1 minute - Hound_Timer = 8000; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void KilledUnit(Unit* /*victim*/) - { - // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70, 000 health. - DoCast(me, SPELL_CAPTURESOUL); - } - - void SummonHounds(Unit* victim) - { - if (Creature* Hound = DoSpawnCreature(19207, float(irand(-9, 9)), float(irand(-9, 9)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) - Hound->AI()->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer <= diff) - { - if (urand(0, 99) < 45) - DoCast(me->getVictim(), SPELL_SHADOWVOLLEY); - - ShadowVolley_Timer = 5000; - } else ShadowVolley_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - if (urand(0, 1)) - DoCast(me->getVictim(), SPELL_CLEAVE); - - Cleave_Timer = 10000; - } else Cleave_Timer -= diff; - - //ThunderClap_Timer - if (ThunderClap_Timer <= diff) - { - if (urand(0, 9) < 2) - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - - ThunderClap_Timer = 12000; - } else ThunderClap_Timer -= diff; - - //TwistedReflection_Timer - if (TwistedReflection_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TWISTEDREFLECTION); - TwistedReflection_Timer = 30000; - } else TwistedReflection_Timer -= diff; - - //VoidBolt_Timer - if (VoidBolt_Timer <= diff) - { - if (urand(0, 9) < 4) - DoCast(me->getVictim(), SPELL_VOIDBOLT); - - VoidBolt_Timer = 18000; - } else VoidBolt_Timer -= diff; - - //Rage_Timer - if (Rage_Timer <= diff) - { - DoCast(me, SPELL_RAGE); - Rage_Timer = 70000; - } else Rage_Timer -= diff; - - //Hound_Timer - if (Hound_Timer <= diff) - { - SummonHounds(me->getVictim()); - SummonHounds(me->getVictim()); - SummonHounds(me->getVictim()); - - Hound_Timer = 45000; - } else Hound_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; -}; - -void AddSC_boss_kruul() -{ - new boss_kruul(); -} diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index eec747d6d73..3f8e86753dd 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -18,140 +18,18 @@ /* ScriptData SDName: Burning_Steppes -SD%Complete: 100 -SDComment: Quest support: 4224, 4866 +SD%Complete: 0 +SDComment: SDCategory: Burning Steppes EndScriptData */ -/* ContentData -npc_ragged_john -EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_ragged_john -######*/ - -#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him." -#define GOSSIP_SELECT1 "So what did you do?" -#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'." -#define GOSSIP_SELECT3 "Ironfoe?" -#define GOSSIP_SELECT4 "Interesting... continue John." -#define GOSSIP_SELECT5 "So that's how Windsor died..." -#define GOSSIP_SELECT6 "So how did he die?" -#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?" -#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?" -#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?" -#define GOSSIP_SELECT10 "Ahh... Ironfoe" -#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative" - -class npc_ragged_john : public CreatureScript -{ -public: - npc_ragged_john() : CreatureScript("npc_ragged_john") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2714, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2715, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2716, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(2717, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(2718, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(2719, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - player->SEND_GOSSIP_MENU(2720, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); - player->SEND_GOSSIP_MENU(2721, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); - player->SEND_GOSSIP_MENU(2722, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); - player->SEND_GOSSIP_MENU(2723, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+10: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(2725, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(4224); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(2713, creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ragged_johnAI (creature); - } - - struct npc_ragged_johnAI : public ScriptedAI - { - npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() {} - - void MoveInLineOfSight(Unit* who) - { - if (who->HasAura(16468)) - { - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me)) - { - DoCast(who, 16472); - CAST_PLR(who)->AreaExploredOrEventHappens(4866); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit* /*who*/) {} - }; -}; void AddSC_burning_steppes() { - new npc_ragged_john(); + } diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 9793c6fd31c..dcc938f35fe 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -19,13 +19,11 @@ /* ScriptData SDName: Ghostlands SD%Complete: 100 -SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber +SDComment: SDCategory: Ghostlands EndScriptData */ /* ContentData -npc_blood_knight_dawnstar -npc_budd_nedreck npc_rathis_tomber npc_ranger_lilatha EndContentData */ @@ -36,41 +34,6 @@ EndContentData */ #include "ScriptedEscortAI.h" /*###### -## npc_budd_nedreck -######*/ - -#define GOSSIP_HBN "You gave the crew disguises?" - -class npc_budd_nedreck : public CreatureScript -{ -public: - npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 42540, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } -}; - -/*###### ## npc_rathis_tomber ######*/ @@ -218,7 +181,6 @@ public: void AddSC_ghostlands() { - new npc_budd_nedreck(); new npc_rathis_tomber(); new npc_ranger_lilatha(); } diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index a6d01f0ca93..096c0f2e2a6 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -19,13 +19,12 @@ /* ScriptData SDName: Hinterlands SD%Complete: 100 -SDComment: Quest support: 863, 2742 +SDComment: Quest support: 836 SDCategory: The Hinterlands EndScriptData */ /* ContentData npc_00x09hl -npc_rinji EndContentData */ #include "ScriptMgr.h" @@ -149,205 +148,7 @@ public: }; }; -/*###### -## npc_rinji -######*/ - -enum eRinji -{ - SAY_RIN_FREE = -1000403, //from here - SAY_RIN_BY_OUTRUNNER = -1000404, - SAY_RIN_HELP_1 = -1000405, - SAY_RIN_HELP_2 = -1000406, //to here, are used also by 6182 but this is wrong... - SAY_RIN_COMPLETE = -1000407, - SAY_RIN_PROGRESS_1 = -1000408, - SAY_RIN_PROGRESS_2 = -1000409, - - QUEST_RINJI_TRAPPED = 2742, - NPC_RANGER = 2694, - NPC_OUTRUNNER = 2691, - GO_RINJI_CAGE = 142036 -}; - -struct Location -{ - float m_fX, m_fY, m_fZ; -}; - -Location m_afAmbushSpawn[] = -{ - {191.296204f, -2839.329346f, 107.388f}, - {70.972466f, -2848.674805f, 109.459f} -}; - -Location m_afAmbushMoveTo[] = -{ - {166.630386f, -2824.780273f, 108.153f}, - {70.886589f, -2874.335449f, 116.675f} -}; - -class npc_rinji : public CreatureScript -{ -public: - npc_rinji() : CreatureScript("npc_rinji") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RINJI_TRAPPED) - { - if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) - go->UseDoorOrButton(); - - if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_rinjiAI(creature); - } - - struct npc_rinjiAI : public npc_escortAI - { - npc_rinjiAI(Creature* creature) : npc_escortAI(creature) - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - } - - bool m_bIsByOutrunner; - uint32 m_uiPostEventCount; - uint32 m_uiPostEventTimer; - int m_iSpawnId; - - void Reset() - { - m_uiPostEventCount = 0; - m_uiPostEventTimer = 3000; - } - - void JustRespawned() - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - - npc_escortAI::JustRespawned(); - } - - void EnterCombat(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) - { - DoScriptText(SAY_RIN_BY_OUTRUNNER, who); - m_bIsByOutrunner = true; - } - - if (rand()%4) - return; - - //only if attacked and escorter is not in combat? - DoScriptText(RAND(SAY_RIN_HELP_1, SAY_RIN_HELP_2), me); - } - } - - void DoSpawnAmbush(bool bFirst) - { - if (!bFirst) - m_iSpawnId = 1; - - me->SummonCreature(NPC_RANGER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - - for (int i = 0; i < 2; ++i) - { - me->SummonCreature(NPC_OUTRUNNER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->SetWalk(false); - summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 1: - DoScriptText(SAY_RIN_FREE, me, player); - break; - case 7: - DoSpawnAmbush(true); - break; - case 13: - DoSpawnAmbush(false); - break; - case 17: - DoScriptText(SAY_RIN_COMPLETE, me, player); - player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); - SetRun(); - m_uiPostEventCount = 1; - break; - } - } - - void UpdateEscortAI(const uint32 uiDiff) - { - //Check if we have a current target - if (!UpdateVictim()) - { - if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount) - { - if (m_uiPostEventTimer <= uiDiff) - { - m_uiPostEventTimer = 3000; - - if (Player* player = GetPlayerForEscort()) - { - switch (m_uiPostEventCount) - { - case 1: - DoScriptText(SAY_RIN_PROGRESS_1, me, player); - ++m_uiPostEventCount; - break; - case 2: - DoScriptText(SAY_RIN_PROGRESS_2, me, player); - m_uiPostEventCount = 0; - break; - } - } - else - { - me->DespawnOrUnsummon(); - return; - } - } - else - m_uiPostEventTimer -= uiDiff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_hinterlands() { new npc_00x09hl(); - new npc_rinji(); } diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 2915ee1f3cb..98a4d780058 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -18,81 +18,18 @@ /* ScriptData SDName: Ironforge -SD%Complete: 100 -SDComment: Quest support: 3702 +SD%Complete: 0 +SDComment: SDCategory: Ironforge EndScriptData */ /* ContentData -npc_royal_historian_archesonus EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_royal_historian_archesonus -######*/ - -#define GOSSIP_ITEM_ROYAL "I am ready to listen" -#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" -#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." -#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" -#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" - -class npc_royal_historian_archesonus : public CreatureScript -{ -public: - npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2236, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2237, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2238, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(2239, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3702); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(2235, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - void AddSC_ironforge() { - new npc_royal_historian_archesonus(); } diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index 4e3aaae71a1..32862a2d7b0 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -18,88 +18,18 @@ /* ScriptData SDName: Loch_Modan -SD%Complete: 100 -SDComment: Quest support: 3181 +SD%Complete: 0 +SDComment: SDCategory: Loch Modan EndScriptData */ /* ContentData -npc_mountaineer_pebblebitty EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_mountaineer_pebblebitty -######*/ - -#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge" - -#define GOSSIP_MP1 "But i need to get there, now open the gate!" -#define GOSSIP_MP2 "Ok, so what is this other way?" -#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable." -#define GOSSIP_MP4 "Yes..." -#define GOSSIP_MP5 "Ok, i'll try to remember that." -#define GOSSIP_MP6 "A key? Ok!" - -class npc_mountaineer_pebblebitty : public CreatureScript -{ -public: - npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(1833, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(1834, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(1835, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(1836, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(1837, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - player->SEND_GOSSIP_MENU(1838, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->CLOSE_GOSSIP_MENU(); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (!player->GetQuestRewardStatus(3181) == 1) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - void AddSC_loch_modan() { - new npc_mountaineer_pebblebitty(); } diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index 2473fec899a..81223dad1d3 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -17,156 +17,14 @@ /* Script Data Start SDName: Redridge Mountains -SD%Complete: 100% -SDComment: Support for quest 219. +SD%Complete: 0 +SDComment: Script Data End */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" -enum eCorporalKeeshan -{ - QUEST_MISSING_IN_ACTION = 219, - - SAY_CORPORAL_1 = -1000464, - SAY_CORPORAL_2 = -1000465, - SAY_CORPORAL_3 = -1000466, - SAY_CORPORAL_4 = -1000467, - SAY_CORPORAL_5 = -1000468, - - SPELL_MOCKING_BLOW = 21008, - SPELL_SHIELD_BASH = 11972, -}; - -class npc_corporal_keeshan : public CreatureScript -{ -public: - npc_corporal_keeshan() : CreatureScript("npc_corporal_keeshan") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) - { - CAST_AI(npc_corporal_keeshan::npc_corporal_keeshanAI, creature->AI())->Start(true, false, player->GetGUID(), quest); - DoScriptText(SAY_CORPORAL_1, creature); - } - - return false; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_corporal_keeshanAI(creature); - } - - struct npc_corporal_keeshanAI : public npc_escortAI - { - npc_corporal_keeshanAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 uiPhase; - uint32 uiTimer; - uint32 uiMockingBlowTimer; - uint32 uiShieldBashTimer; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - uiMockingBlowTimer = 5000; - uiShieldBashTimer = 8000; - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) - me->SetWalk(false); - - switch (waypointId) - { - case 39: - SetEscortPaused(true); - uiTimer = 2000; - uiPhase = 1; - break; - case 65: - me->SetWalk(false); - break; - case 115: - player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); - uiTimer = 2000; - uiPhase = 4; - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (HasEscortState(STATE_ESCORT_NONE)) - return; - - npc_escortAI::UpdateAI(uiDiff); - - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - me->SetStandState(UNIT_STAND_STATE_SIT); - uiTimer = 1000; - uiPhase = 2; - break; - case 2: - DoScriptText(SAY_CORPORAL_2, me); - uiTimer = 15000; - uiPhase = 3; - break; - case 3: - DoScriptText(SAY_CORPORAL_3, me); - me->SetStandState(UNIT_STAND_STATE_STAND); - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 4: - DoScriptText(SAY_CORPORAL_4, me); - uiTimer = 2500; - uiPhase = 5; - case 5: - DoScriptText(SAY_CORPORAL_5, me); - uiTimer = 0; - uiPhase = 0; - } - } else uiTimer -= uiDiff; - } - - if (!UpdateVictim()) - return; - - if (uiMockingBlowTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MOCKING_BLOW); - uiMockingBlowTimer = 5000; - } else uiMockingBlowTimer -= uiDiff; - - if (uiShieldBashTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MOCKING_BLOW); - uiShieldBashTimer = 8000; - } else uiShieldBashTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_redridge_mountains() { - new npc_corporal_keeshan(); } diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 870cb29c28d..8f5925405ec 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -19,13 +19,12 @@ /* ScriptData SDName: Silverpine_Forest SD%Complete: 100 -SDComment: Quest support: 435, 452 +SDComment: Quest support: 435 SDCategory: Silverpine Forest EndScriptData */ /* ContentData npc_deathstalker_erland -pyrewood_ambush EndContentData */ #include "ScriptMgr.h" @@ -136,196 +135,10 @@ public: }; /*###### -## pyrewood_ambush -#######*/ - -#define QUEST_PYREWOOD_AMBUSH 452 - -#define NPCSAY_INIT "Get ready, they'll be arriving any minute..." //not blizzlike -#define NPCSAY_END "Thanks for your help!" //not blizzlike - -static float PyrewoodSpawnPoints[3][4] = -{ - //pos_x pos_y pos_z orien - //outside - /* - {-400.85f, 1513.64f, 18.67f, 0}, - {-397.32f, 1514.12f, 18.67f, 0}, - {-397.44f, 1511.09f, 18.67f, 0}, - */ - //door - {-396.17f, 1505.86f, 19.77f, 0}, - {-396.91f, 1505.77f, 19.77f, 0}, - {-397.94f, 1504.74f, 19.77f, 0}, -}; - -#define WAIT_SECS 6000 - -class pyrewood_ambush : public CreatureScript -{ -public: - pyrewood_ambush() : CreatureScript("pyrewood_ambush") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest *quest) - { - if (quest->GetQuestId() == QUEST_PYREWOOD_AMBUSH && !CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress) - { - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress = true; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->Phase = 0; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->KillCount = 0; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->PlayerGUID = player->GetGUID(); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new pyrewood_ambushAI (creature); - } - - struct pyrewood_ambushAI : public ScriptedAI - { - pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) - { - QuestInProgress = false; - } - - uint32 Phase; - int8 KillCount; - uint32 WaitTimer; - uint64 PlayerGUID; - SummonList Summons; - - bool QuestInProgress; - - void Reset() - { - WaitTimer = WAIT_SECS; - - if (!QuestInProgress) //fix reset values (see UpdateVictim) - { - Phase = 0; - KillCount = 0; - PlayerGUID = 0; - Summons.DespawnAll(); - } - } - - void EnterCombat(Unit* /*who*/){} - - void JustSummoned(Creature* summoned) - { - Summons.Summon(summoned); - ++KillCount; - } - - void SummonedCreatureDespawn(Creature* summoned) - { - Summons.Despawn(summoned); - --KillCount; - } - - void SummonCreatureWithRandomTarget(uint32 creatureId, int position) - { - if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000)) - { - Player* player = NULL; - Unit* target = NULL; - if (PlayerGUID) - { - player = Unit::GetPlayer(*me, PlayerGUID); - if (player) - target = RAND((Unit*)me, (Unit*)player); - } else - target = me; - - if (target) - { - summoned->setFaction(168); - summoned->AddThreat(target, 32.0f); - summoned->AI()->AttackStart(target); - } - } - } - - void JustDied(Unit* /*killer*/) - { - if (PlayerGUID) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - if (player->GetQuestStatus(QUEST_PYREWOOD_AMBUSH) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(QUEST_PYREWOOD_AMBUSH); - } - - void UpdateAI(const uint32 diff) - { - //sLog->outInfo(LOG_FILTER_TSCR, "DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); - - if (!QuestInProgress) - return; - - if (KillCount && Phase < 6) - { - if (!UpdateVictim()) //reset() on target Despawn... - return; - - DoMeleeAttackIfReady(); - return; - } - - switch (Phase) - { - case 0: - if (WaitTimer == WAIT_SECS) - me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike - - if (WaitTimer <= diff) - { - WaitTimer -= diff; - return; - } - break; - case 1: - SummonCreatureWithRandomTarget(2060, 1); - break; - case 2: - SummonCreatureWithRandomTarget(2061, 2); - SummonCreatureWithRandomTarget(2062, 0); - break; - case 3: - SummonCreatureWithRandomTarget(2063, 1); - SummonCreatureWithRandomTarget(2064, 2); - SummonCreatureWithRandomTarget(2065, 0); - break; - case 4: - SummonCreatureWithRandomTarget(2066, 1); - SummonCreatureWithRandomTarget(2067, 0); - SummonCreatureWithRandomTarget(2068, 2); - break; - case 5: //end - if (PlayerGUID) - { - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - { - me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike - player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); - } - } - QuestInProgress = false; - Reset(); - break; - } - ++Phase; //prepare next phase - } - }; -}; - -/*###### ## AddSC ######*/ void AddSC_silverpine_forest() { new npc_deathstalker_erland(); - new pyrewood_ambush(); } diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 560214d4085..f5ade53202a 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -18,19 +18,12 @@ /* ScriptData SDName: Stormwind_City -SD%Complete: 100 -SDComment: Quest support: 1640, 1447, 4185, 11223, 434. +SD%Complete: 0 +SDComment: SDCategory: Stormwind City EndScriptData */ /* ContentData -npc_archmage_malin -npc_bartleby -npc_lady_katrana_prestor -npc_tyrion -npc_tyrion_spybot -npc_marzon_silent_blade -npc_lord_gregor_lescovar EndContentData */ #include "ScriptMgr.h" @@ -38,609 +31,7 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*###### -## npc_archmage_malin -######*/ - -#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." - -class npc_archmage_malin : public CreatureScript -{ -public: - npc_archmage_malin() : CreatureScript("npc_archmage_malin") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 42711, true); - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_bartleby -######*/ - -enum eBartleby -{ - FACTION_ENEMY = 168, - QUEST_BEAT = 1640 -}; - -class npc_bartleby : public CreatureScript -{ -public: - npc_bartleby() : CreatureScript("npc_bartleby") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_BEAT) - { - creature->setFaction(FACTION_ENEMY); - creature->AI()->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_bartlebyAI(creature); - } - - struct npc_bartlebyAI : public ScriptedAI - { - npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) - { - m_uiNormalFaction = creature->getFaction(); - } - - uint32 m_uiNormalFaction; - - void Reset() - { - if (me->getFaction() != m_uiNormalFaction) - me->setFaction(m_uiNormalFaction); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - //Take 0 damage - uiDamage = 0; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); - EnterEvadeMode(); - } - } - }; -}; - -/*###### -## npc_lady_katrana_prestor -######*/ - -#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." -#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." -#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." -#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." - -class npc_lady_katrana_prestor : public CreatureScript -{ -public: - npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2694, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2695, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2696, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(4185); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(2693, creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_lord_gregor_lescovar -######*/ - -enum eLordGregorLescovar -{ - SAY_LESCOVAR_2 = -1000457, - SAY_GUARD_2 = -1000458, - SAY_LESCOVAR_3 = -1000459, - SAY_MARZON_1 = -1000460, - SAY_LESCOVAR_4 = -1000461, - SAY_TYRION_2 = -1000462, - SAY_MARZON_2 = -1000463, - - NPC_STORMWIND_ROYAL = 1756, - NPC_MARZON_BLADE = 1755, - NPC_TYRION = 7766, - - QUEST_THE_ATTACK = 434 -}; - -class npc_lord_gregor_lescovar : public CreatureScript -{ -public: - npc_lord_gregor_lescovar() : CreatureScript("npc_lord_gregor_lescovar") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lord_gregor_lescovarAI(creature); - } - - struct npc_lord_gregor_lescovarAI : public npc_escortAI - { - npc_lord_gregor_lescovarAI(Creature* creature) : npc_escortAI(creature) - { - creature->RestoreFaction(); - } - - uint32 uiTimer; - uint32 uiPhase; - - uint64 MarzonGUID; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - - MarzonGUID = 0; - } - - void EnterEvadeMode() - { - me->DisappearAndDie(); - - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - { - if (pMarzon->isAlive()) - pMarzon->DisappearAndDie(); - } - } - - void EnterCombat(Unit* who) - { - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - { - if (pMarzon->isAlive() && !pMarzon->isInCombat()) - pMarzon->AI()->AttackStart(who); - } - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 14: - SetEscortPaused(true); - DoScriptText(SAY_LESCOVAR_2, me); - uiTimer = 3000; - uiPhase = 1; - break; - case 16: - SetEscortPaused(true); - if (Creature* pMarzon = me->SummonCreature(NPC_MARZON_BLADE, -8411.360352f, 480.069733f, 123.760895f, 4.941504f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) - { - pMarzon->GetMotionMaster()->MovePoint(0, -8408.000977f, 468.611450f, 123.759903f); - MarzonGUID = pMarzon->GetGUID(); - } - uiTimer = 2000; - uiPhase = 4; - break; - } - } - //TO-DO: We don't have movemaps, also we can't make 2 npcs walks to one point propperly (and we can not use escort ai, because they are 2 different spawns and with same entry), because of it we make them, disappear. - void DoGuardsDisappearAndDie() - { - std::list<Creature*> GuardList; - me->GetCreatureListWithEntryInGrid(GuardList, NPC_STORMWIND_ROYAL, 8.0f); - if (!GuardList.empty()) - { - for (std::list<Creature*>::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr) - { - if (Creature* pGuard = *itr) - pGuard->DisappearAndDie(); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) - DoScriptText(SAY_GUARD_2, pGuard); - uiTimer = 3000; - uiPhase = 2; - break; - case 2: - DoGuardsDisappearAndDie(); - uiTimer = 2000; - uiPhase = 3; - break; - case 3: - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 4: - DoScriptText(SAY_LESCOVAR_3, me); - uiTimer = 0; - uiPhase = 0; - break; - case 5: - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - DoScriptText(SAY_MARZON_1, pMarzon); - uiTimer = 3000; - uiPhase = 6; - break; - case 6: - DoScriptText(SAY_LESCOVAR_4, me); - if (Player* player = GetPlayerForEscort()) - player->AreaExploredOrEventHappens(QUEST_THE_ATTACK); - uiTimer = 2000; - uiPhase = 7; - break; - case 7: - if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) - DoScriptText(SAY_TYRION_2, pTyrion); - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - pMarzon->setFaction(14); - me->setFaction(14); - uiTimer = 0; - uiPhase = 0; - break; - } - } else uiTimer -= uiDiff; - } - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_marzon_silent_blade -######*/ - -class npc_marzon_silent_blade : public CreatureScript -{ -public: - npc_marzon_silent_blade() : CreatureScript("npc_marzon_silent_blade") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_marzon_silent_bladeAI(creature); - } - - struct npc_marzon_silent_bladeAI : public ScriptedAI - { - npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) - { - me->SetWalk(true); - } - - void Reset() - { - me->RestoreFaction(); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_MARZON_2, me); - - if (me->isSummon()) - { - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) - summoner->ToCreature()->AI()->AttackStart(who); - } - } - } - - void EnterEvadeMode() - { - me->DisappearAndDie(); - - if (me->isSummon()) - { - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) - summoner->ToCreature()->DisappearAndDie(); - } - } - } - - void MovementInform(uint32 uiType, uint32 /*uiId*/) - { - if (uiType != POINT_MOTION_TYPE) - return; - - if (me->isSummon()) - { - Unit* summoner = me->ToTempSummon()->GetSummoner(); - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAIEnabled) - { - npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI* ai = - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, summoner->GetAI()); - if (ai) - { - ai->uiTimer = 2000; - ai->uiPhase = 5; - } - //me->ChangeOrient(0.0f, summoner); - } - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_tyrion_spybot -######*/ - -enum eTyrionSpybot -{ - SAY_QUEST_ACCEPT_ATTACK = -1000499, - SAY_TYRION_1 = -1000450, - SAY_SPYBOT_1 = -1000451, - SAY_GUARD_1 = -1000452, - SAY_SPYBOT_2 = -1000453, - SAY_SPYBOT_3 = -1000454, - SAY_LESCOVAR_1 = -1000455, - SAY_SPYBOT_4 = -1000456, - - NPC_PRIESTESS_TYRIONA = 7779, - NPC_LORD_GREGOR_LESCOVAR = 1754, -}; - -class npc_tyrion_spybot : public CreatureScript -{ -public: - npc_tyrion_spybot() : CreatureScript("npc_tyrion_spybot") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tyrion_spybotAI(creature); - } - - struct npc_tyrion_spybotAI : public npc_escortAI - { - npc_tyrion_spybotAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 uiTimer; - uint32 uiPhase; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 1: - SetEscortPaused(true); - uiTimer = 2000; - uiPhase = 1; - break; - case 5: - SetEscortPaused(true); - DoScriptText(SAY_SPYBOT_1, me); - uiTimer = 2000; - uiPhase = 5; - break; - case 17: - SetEscortPaused(true); - DoScriptText(SAY_SPYBOT_3, me); - uiTimer = 3000; - uiPhase = 8; - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - DoScriptText(SAY_QUEST_ACCEPT_ATTACK, me); - uiTimer = 3000; - uiPhase = 2; - break; - case 2: - if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 10.0f)) - DoScriptText(SAY_TYRION_1, pTyrion); - uiTimer = 3000; - uiPhase = 3; - break; - case 3: - me->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE); - uiTimer = 2000; - uiPhase = 4; - break; - case 4: - SetEscortPaused(false); - uiPhase = 0; - uiTimer = 0; - break; - case 5: - if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true)) - DoScriptText(SAY_GUARD_1, pGuard); - uiTimer = 3000; - uiPhase = 6; - break; - case 6: - DoScriptText(SAY_SPYBOT_2, me); - uiTimer = 3000; - uiPhase = 7; - break; - case 7: - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 8: - if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) - DoScriptText(SAY_LESCOVAR_1, pLescovar); - uiTimer = 3000; - uiPhase = 9; - break; - case 9: - DoScriptText(SAY_SPYBOT_4, me); - uiTimer = 3000; - uiPhase = 10; - break; - case 10: - if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) - { - if (Player* player = GetPlayerForEscort()) - { - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, false, player->GetGUID()); - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f); - } - } - me->DisappearAndDie(); - uiTimer = 0; - uiPhase = 0; - break; - } - } else uiTimer -= uiDiff; - } - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_tyrion -######*/ - -enum eTyrion -{ - NPC_TYRION_SPYBOT = 8856 -}; - -class npc_tyrion : public CreatureScript -{ -public: - npc_tyrion() : CreatureScript("npc_tyrion") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_THE_ATTACK) - { - if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true)) - { - CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID()); - CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f); - } - return true; - } - return false; - } -}; void AddSC_stormwind_city() { - new npc_archmage_malin(); - new npc_bartleby(); - new npc_lady_katrana_prestor(); - new npc_tyrion(); - new npc_tyrion_spybot(); - new npc_lord_gregor_lescovar(); - new npc_marzon_silent_blade(); } diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp index 4c81380fb60..9724588039f 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp @@ -20,136 +20,6 @@ #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" -/*###### -## npc_galen_goodward -######*/ - -enum Galen -{ - QUEST_GALENS_ESCAPE = 1393, - - GO_GALENS_CAGE = 37118, - - SAY_PERIODIC = -1000500, - SAY_QUEST_ACCEPTED = -1000501, - SAY_ATTACKED_1 = -1000502, - SAY_ATTACKED_2 = -1000503, - SAY_QUEST_COMPLETE = -1000504, - EMOTE_WHISPER = -1000505, - EMOTE_DISAPPEAR = -1000506 -}; - -class npc_galen_goodward : public CreatureScript -{ -public: - - npc_galen_goodward() : CreatureScript("npc_galen_goodward") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_GALENS_ESCAPE) - { - CAST_AI(npc_galen_goodward::npc_galen_goodwardAI, creature->AI())->Start(false, false, player->GetGUID()); - creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); - DoScriptText(SAY_QUEST_ACCEPTED, creature); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_galen_goodwardAI(creature); - } - - struct npc_galen_goodwardAI : public npc_escortAI - { - npc_galen_goodwardAI(Creature* creature) : npc_escortAI(creature) - { - m_uiGalensCageGUID = 0; - Reset(); - } - - uint64 m_uiGalensCageGUID; - uint32 m_uiPeriodicSay; - - void Reset() - { - m_uiPeriodicSay = 6000; - } - - void EnterCombat(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - DoScriptText(RAND(SAY_ATTACKED_1, SAY_ATTACKED_2), me, who); - } - - void WaypointStart(uint32 uiPointId) - { - switch (uiPointId) - { - case 0: - { - GameObject* pCage = NULL; - if (m_uiGalensCageGUID) - pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID); - else - pCage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE); - if (pCage) - { - pCage->UseDoorOrButton(); - m_uiGalensCageGUID = pCage->GetGUID(); - } - break; - } - case 21: - DoScriptText(EMOTE_DISAPPEAR, me); - break; - } - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 0: - if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) - pCage->ResetDoorOrButton(); - break; - case 20: - if (Player* player = GetPlayerForEscort()) - { - me->SetFacingToObject(player); - DoScriptText(SAY_QUEST_COMPLETE, me, player); - DoScriptText(EMOTE_WHISPER, me, player); - player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); - } - SetRun(true); - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (HasEscortState(STATE_ESCORT_NONE)) - return; - - if (m_uiPeriodicSay < uiDiff) - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - DoScriptText(SAY_PERIODIC, me); - m_uiPeriodicSay = 15000; - } - else - m_uiPeriodicSay -= uiDiff; - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_swamp_of_sorrows() { - new npc_galen_goodward(); } diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 70f9f93c7a7..cbefd115739 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -18,199 +18,18 @@ /* ScriptData SDName: Tirisfal_Glades -SD%Complete: 100 -SDComment: Quest support: 590, 1819 +SD%Complete: 0 +SDComment: SDCategory: Tirisfal Glades EndScriptData */ /* ContentData -npc_calvin_montague -go_mausoleum_door -go_mausoleum_trigger EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -/*###### -## npc_calvin_montague -######*/ - -enum eCalvin -{ - SAY_COMPLETE = -1000431, - SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) - QUEST_590 = 590, - FACTION_HOSTILE = 168 -}; - -class npc_calvin_montague : public CreatureScript -{ -public: - npc_calvin_montague() : CreatureScript("npc_calvin_montague") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_590) - { - creature->setFaction(FACTION_HOSTILE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_calvin_montagueAI (creature); - } - - struct npc_calvin_montagueAI : public ScriptedAI - { - npc_calvin_montagueAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 m_uiPhase; - uint32 m_uiPhaseTimer; - uint64 m_uiPlayerGUID; - - void Reset() - { - m_uiPhase = 0; - m_uiPhaseTimer = 5000; - m_uiPlayerGUID = 0; - - me->RestoreFaction(); - - if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - } - - void EnterCombat(Unit* /*who*/) {} - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim() || me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - uiDamage = 0; - - me->RestoreFaction(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->CombatStop(true); - - m_uiPhase = 1; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - m_uiPlayerGUID = pDoneBy->GetGUID(); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_uiPhase) - { - if (m_uiPhaseTimer <= uiDiff) - m_uiPhaseTimer = 7500; - else - { - m_uiPhaseTimer -= uiDiff; - return; - } - - switch (m_uiPhase) - { - case 1: - DoScriptText(SAY_COMPLETE, me); - ++m_uiPhase; - break; - case 2: - if (Player* player = Unit::GetPlayer(*me, m_uiPlayerGUID)) - player->AreaExploredOrEventHappens(QUEST_590); - - DoCast(me, SPELL_DRINK, true); - ++m_uiPhase; - break; - case 3: - EnterEvadeMode(); - break; - } - - return; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## go_mausoleum_door -## go_mausoleum_trigger -######*/ - -enum eMausoleum -{ - QUEST_ULAG = 1819, - NPC_ULAG = 6390, - GO_TRIGGER = 104593, - GO_DOOR = 176594 -}; - -class go_mausoleum_door : public GameObjectScript -{ -public: - go_mausoleum_door() : GameObjectScript("go_mausoleum_door") { } - - bool OnGossipHello(Player* player, GameObject* /*go*/) - { - if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pTrigger = player->FindNearestGameObject(GO_TRIGGER, 30.0f)) - { - pTrigger->SetGoState(GO_STATE_READY); - player->SummonCreature(NPC_ULAG, 2390.26f, 336.47f, 40.01f, 2.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); - return false; - } - - return false; - } -}; - -class go_mausoleum_trigger : public GameObjectScript -{ -public: - go_mausoleum_trigger() : GameObjectScript("go_mausoleum_trigger") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pDoor = player->FindNearestGameObject(GO_DOOR, 30.0f)) - { - go->SetGoState(GO_STATE_ACTIVE); - pDoor->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); - return true; - } - - return false; - } -}; void AddSC_tirisfal_glades() { - new npc_calvin_montague(); - new go_mausoleum_door(); - new go_mausoleum_trigger(); } diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 7f63c521594..f54c23afb3c 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -101,7 +101,6 @@ set(scripts_STAT_SRCS Kalimdor/WailingCaverns/wailing_caverns.cpp Kalimdor/durotar.cpp Kalimdor/felwood.cpp - Kalimdor/boss_azuregos.cpp Kalimdor/tanaris.cpp Kalimdor/dustwallow_marsh.cpp Kalimdor/winterspring.cpp diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 8d08c26f0a7..740f3d5c7e2 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -18,507 +18,18 @@ /* ScriptData SDName: Azshara -SD%Complete: 90 -SDComment: Quest support: 2744, 3141, 9364, 10994 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Azshara EndScriptData */ /* ContentData -mobs_spitelashes -npc_loramus_thalipedes -mob_rizzle_sprysprocket -mob_depth_charge EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## mobs_spitelashes -######*/ - -class mobs_spitelashes : public CreatureScript -{ -public: - mobs_spitelashes() : CreatureScript("mobs_spitelashes") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_spitelashesAI (creature); - } - - struct mobs_spitelashesAI : public ScriptedAI - { - mobs_spitelashesAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 morphtimer; - bool spellhit; - - void Reset() - { - morphtimer = 0; - spellhit = false; - } - - void EnterCombat(Unit* /*who*/) { } - - void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) - { - if (!spellhit && - Hitter->GetTypeId() == TYPEID_PLAYER && - CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && - (Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826)) - { - spellhit=true; - DoCast(me, 29124); //become a sheep - } - } - - void UpdateAI(const uint32 diff) - { - // we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons - if (spellhit && morphtimer >= 5000) - { - me->DespawnOrUnsummon(); - return; - } - // walk 5 seconds before summoning - if (spellhit && morphtimer<5000) - { - morphtimer+=diff; - if (morphtimer >= 5000) - { - DoCast(me, 28406); //summon copies - DoCast(me, 6924); //visual explosion - } - } - if (!UpdateVictim()) - return; - - //TODO: add abilities for the different creatures - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## npc_loramus_thalipedes -######*/ - -#define GOSSIP_HELLO_LT1 "Can you help me?" -#define GOSSIP_HELLO_LT2 "Tell me your story" -#define GOSSIP_SELECT_LT1 "Please continue" -#define GOSSIP_SELECT_LT2 "I do not understand" -#define GOSSIP_SELECT_LT3 "Indeed" -#define GOSSIP_SELECT_LT4 "I will do this with or your help, Loramus" -#define GOSSIP_SELECT_LT5 "Yes" - -class npc_loramus_thalipedes : public CreatureScript -{ -public: - npc_loramus_thalipedes() : CreatureScript("npc_loramus_thalipedes") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2744); - break; - - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - player->SEND_GOSSIP_MENU(1813, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - player->SEND_GOSSIP_MENU(1814, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); - player->SEND_GOSSIP_MENU(1815, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+23: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); - player->SEND_GOSSIP_MENU(1816, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+24: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); - player->SEND_GOSSIP_MENU(1817, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+25: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3141); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*#### -# mob_rizzle_sprysprocket -####*/ - -enum RizzleSprysprocketData -{ - QUEST_CHASING_THE_MOONSTONE = 10994, - - MOB_DEPTH_CHARGE = 23025, - - SPELL_RIZZLE_BLACKJACK = 39865, - SPELL_RIZZLE_ESCAPE = 39871, - SPELL_RIZZLE_FROST_GRENADE = 40525, - SPELL_DEPTH_CHARGE_TRAP = 38576, - SPELL_PERIODIC_DEPTH_CHARGE = 39912, - SPELL_GIVE_SOUTHFURY_MOONSTONE = 39886, - - SAY_RIZZLE_START = -1000351, - MSG_ESCAPE_NOTICE = -1000352, - SAY_RIZZLE_GRENADE = -1000353, - SAY_RIZZLE_GRENADE_BACKFIRE = -1000354, // Not used - SAY_RIZZLE_FINAL = -1000355, - SAY_RIZZLE_FINAL2 = -1000356, // Not used -}; - -#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." - -Position const WPs[58] = -{ - {3691.97f, -3962.41f, 35.9118f, 3.67f}, - {3675.02f, -3960.49f, 35.9118f, 3.67f}, - {3653.19f, -3958.33f, 33.9118f, 3.59f}, - {3621.12f, -3958.51f, 29.9118f, 3.48f}, - {3604.86f, -3963, 29.9118f, 3.48f}, - {3569.94f, -3970.25f, 29.9118f, 3.44f}, - {3541.03f, -3975.64f, 29.9118f, 3.41f}, - {3510.84f, -3978.71f, 29.9118f, 3.41f}, - {3472.7f, -3997.07f, 29.9118f, 3.35f}, - {3439.15f, -4014.55f, 29.9118f, 3.29f}, - {3412.8f, -4025.87f, 29.9118f, 3.25f}, - {3384.95f, -4038.04f, 29.9118f, 3.24f}, - {3346.77f, -4052.93f, 29.9118f, 3.22f}, - {3299.56f, -4071.59f, 29.9118f, 3.20f}, - {3261.22f, -4080.38f, 30.9118f, 3.19f}, - {3220.68f, -4083.09f, 31.9118f, 3.18f}, - {3187.11f, -4070.45f, 33.9118f, 3.16f}, - {3162.78f, -4062.75f, 33.9118f, 3.15f}, - {3136.09f, -4050.32f, 33.9118f, 3.07f}, - {3119.47f, -4044.51f, 36.0363f, 3.07f}, - {3098.95f, -4019.8f, 33.9118f, 3.07f}, - {3073.07f, -4011.42f, 33.9118f, 3.07f}, - {3051.71f, -3993.37f, 33.9118f, 3.02f}, - {3027.52f, -3978.6f, 33.9118f, 3.00f}, - {3003.78f, -3960.14f, 33.9118f, 2.98f}, - {2977.99f, -3941.98f, 31.9118f, 2.96f}, - {2964.57f, -3932.07f, 30.9118f, 2.96f}, - {2947.9f, -3921.31f, 29.9118f, 2.96f}, - {2924.91f, -3910.8f, 29.9118f, 2.94f}, - {2903.04f, -3896.42f, 29.9118f, 2.93f}, - {2884.75f, -3874.03f, 29.9118f, 2.90f}, - {2868.19f, -3851.48f, 29.9118f, 2.82f}, - {2854.62f, -3819.72f, 29.9118f, 2.80f}, - {2825.53f, -3790.4f, 29.9118f, 2.744f}, - {2804.31f, -3773.05f, 29.9118f, 2.71f}, - {2769.78f, -3763.57f, 29.9118f, 2.70f}, - {2727.23f, -3745.92f, 30.9118f, 2.69f}, - {2680.12f, -3737.49f, 30.9118f, 2.67f}, - {2647.62f, -3739.94f, 30.9118f, 2.66f}, - {2616.6f, -3745.75f, 30.9118f, 2.64f}, - {2589.38f, -3731.97f, 30.9118f, 2.61f}, - {2562.94f, -3722.35f, 31.9118f, 2.56f}, - {2521.05f, -3716.6f, 31.9118f, 2.55f}, - {2485.26f, -3706.67f, 31.9118f, 2.51f}, - {2458.93f, -3696.67f, 31.9118f, 2.51f}, - {2432, -3692.03f, 31.9118f, 2.46f}, - {2399.59f, -3681.97f, 31.9118f, 2.45f}, - {2357.75f, -3666.6f, 31.9118f, 2.44f}, - {2311.99f, -3656.88f, 31.9118f, 2.94f}, - {2263.41f, -3649.55f, 31.9118f, 3.02f}, - {2209.05f, -3641.76f, 31.9118f, 2.99f}, - {2164.83f, -3637.64f, 31.9118f, 3.15f}, - {2122.42f, -3639, 31.9118f, 3.21f}, - {2075.73f, -3643.59f, 31.9118f, 3.22f}, - {2033.59f, -3649.52f, 31.9118f, 3.42f}, - {1985.22f, -3662.99f, 31.9118f, 3.42f}, - {1927.09f, -3679.56f, 33.9118f, 3.42f}, - {1873.57f, -3695.32f, 33.9118f, 3.44f} -}; - -class mob_rizzle_sprysprocket : public CreatureScript -{ -public: - mob_rizzle_sprysprocket() : CreatureScript("mob_rizzle_sprysprocket") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000; - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE) - return true; - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(10811, creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_rizzle_sprysprocketAI (creature); - } - - struct mob_rizzle_sprysprocketAI : public ScriptedAI - { - mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 SpellEscapeTimer; - uint32 TeleportTimer; - uint32 CheckTimer; - uint32 GrenadeTimer; - uint32 MustDieTimer; - uint32 CurrWP; - - uint64 PlayerGUID; - - bool MustDie; - bool Escape; - bool ContinueWP; - bool Reached; - - void Reset() - { - SpellEscapeTimer = 1300; - TeleportTimer = 3500; - CheckTimer = 10000; - GrenadeTimer = 30000; - MustDieTimer = 3000; - CurrWP = 0; - - PlayerGUID = 0; - - MustDie = false; - Escape = false; - ContinueWP = false; - Reached = false; - } - - void UpdateAI(const uint32 diff) - { - if (MustDie) - { - if (MustDieTimer <= diff) - { - me->DespawnOrUnsummon(); - return; - } else MustDieTimer -= diff; - } - - if (!Escape) - { - if (!PlayerGUID) - return; - - if (SpellEscapeTimer <= diff) - { - DoCast(me, SPELL_RIZZLE_ESCAPE, false); - SpellEscapeTimer = 10000; - } else SpellEscapeTimer -= diff; - - if (TeleportTimer <= diff) - { - //temp solution - unit can't be teleported by core using spelleffect 5, only players - if (me->GetMap()) - { - me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0); - me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0); - } - //begin swimming and summon depth charges - Player* player = Unit::GetPlayer(*me, PlayerGUID); - SendText(MSG_ESCAPE_NOTICE, player); - DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE); - me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); - me->SetSpeed(MOVE_RUN, 0.85f, true); - me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); - Escape = true; - } else TeleportTimer -= diff; - - return; - } - - if (ContinueWP) - { - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); - ContinueWP = false; - } - - if (GrenadeTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player) - { - DoScriptText(SAY_RIZZLE_GRENADE, me, player); - DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); - } - GrenadeTimer = 30000; - } else GrenadeTimer -= diff; - - if (CheckTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player) - { - me->DespawnOrUnsummon(); - return; - } - - if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached) - { - DoScriptText(SAY_RIZZLE_FINAL, me); - me->SetUInt32Value(UNIT_NPC_FLAGS, 1); - me->setFaction(35); - me->GetMotionMaster()->MoveIdle(); - me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); - Reached = true; - } - - CheckTimer = 1000; - } else CheckTimer -= diff; - - } - - void SendText(int32 iTextEntry, Player* player) - { - LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); - const char* text = sObjectMgr->GetTrinityString(iTextEntry, loc_idx); - sWorld->SendServerMessage(SERVER_MSG_STRING, text, player); - } - - void AttackStart(Unit* who) - { - if (!who || PlayerGUID) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) - { - PlayerGUID = who->GetGUID(); - DoScriptText(SAY_RIZZLE_START, me); - DoCast(who, SPELL_RIZZLE_BLACKJACK, false); - return; - } - } - - void EnterCombat(Unit* /*who*/) {} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 57) - { - me->DespawnOrUnsummon(); - return; - } - - ++CurrWP; - ContinueWP = true; - } - }; -}; - -/*#### -# mob_depth_charge -####*/ -class mob_depth_charge : public CreatureScript -{ -public: - mob_depth_charge() : CreatureScript("mob_depth_charge") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_depth_chargeAI (creature); - } - - struct mob_depth_chargeAI : public ScriptedAI - { - mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} - - bool WeMustDie; - uint32 WeMustDieTimer; - - void Reset() - { - me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - WeMustDie = false; - WeMustDieTimer = 1000; - } - - void UpdateAI(const uint32 diff) - { - if (WeMustDie) - { - if (WeMustDieTimer <= diff) - me->DespawnOrUnsummon(); - else - WeMustDieTimer -= diff; - } - return; - } - - void MoveInLineOfSight(Unit* who) - { - if (!who) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) - { - DoCast(who, SPELL_DEPTH_CHARGE_TRAP); - WeMustDie = true; - return; - } - } - - void AttackStart(Unit* /*who*/) {} - - void EnterCombat(Unit* /*who*/) {} - }; -}; - void AddSC_azshara() { - new mobs_spitelashes(); - new npc_loramus_thalipedes(); - new mob_rizzle_sprysprocket(); - new mob_depth_charge(); } diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 96e67c8de47..6a109cded3b 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Azuremyst_Isle SD%Complete: 75 -SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. +SDComment: Quest support: 9283, 9537, 9582, 9554, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. SDCategory: Azuremyst Isle EndScriptData */ @@ -28,7 +28,6 @@ npc_draenei_survivor npc_engineer_spark_overgrind npc_injured_draenei npc_magwin -npc_geezle go_ravager_cage npc_death_ravager EndContentData */ @@ -407,166 +406,6 @@ public: }; -/*###### -## npc_geezle -######*/ - -enum Geezle -{ - QUEST_TREES_COMPANY = 9531, - - SPELL_TREE_DISGUISE = 30298, - - GEEZLE_SAY_1 = -1000629, - SPARK_SAY_2 = -1000630, - SPARK_SAY_3 = -1000631, - GEEZLE_SAY_4 = -1000632, - SPARK_SAY_5 = -1000633, - SPARK_SAY_6 = -1000634, - GEEZLE_SAY_7 = -1000635, - - EMOTE_SPARK = -1000636, - - MOB_SPARK = 17243, - GO_NAGA_FLAG = 181694 -}; - -Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f}; - -class npc_geezle : public CreatureScript -{ -public: - npc_geezle() : CreatureScript("npc_geezle") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_geezleAI(creature); - } - - struct npc_geezleAI : public ScriptedAI - { - npc_geezleAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 SparkGUID; - - uint8 Step; - uint32 SayTimer; - - bool EventStarted; - - void Reset() - { - SparkGUID = 0; - Step = 0; - StartEvent(); - } - - void EnterCombat(Unit* /*who*/){} - - void StartEvent() - { - Step = 0; - EventStarted = true; - if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) - { - SparkGUID = Spark->GetGUID(); - Spark->setActive(true); - Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - SayTimer = 8000; - } - - uint32 NextStep(uint8 Step) - { - Creature* Spark = Unit::GetCreature(*me, SparkGUID); - - switch (Step) - { - case 0: - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); - me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); - return 9000; // NPCs are walking up to fire - case 1: - DespawnNagaFlag(true); - DoScriptText(EMOTE_SPARK, Spark); - return 1000; - case 2: - DoScriptText(GEEZLE_SAY_1, me, Spark); - if (Spark) - { - Spark->SetInFront(me); - me->SetInFront(Spark); - } - return 5000; - case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; - case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; - case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000; - case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; - case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; - case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000; - case 9: - me->GetMotionMaster()->MoveTargetedHome(); - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, SparkPos); - CompleteQuest(); - return 9000; - case 10: - if (Spark) - Spark->DisappearAndDie(); - DespawnNagaFlag(false); - me->DisappearAndDie(); - default: return 99999999; - } - } - - // will complete Tree's company quest for all nearby players that are disguised as trees - void CompleteQuest() - { - float radius = 50.0f; - std::list<Player*> players; - Trinity::AnyPlayerInObjectRangeCheck checker(me, radius); - Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker); - me->VisitNearbyWorldObject(radius, searcher); - - for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr) - if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE)) - (*itr)->KilledMonsterCredit(MOB_SPARK, 0); - } - - void DespawnNagaFlag(bool despawn) - { - std::list<GameObject*> FlagList; - me->GetGameObjectListWithEntryInGrid(FlagList, GO_NAGA_FLAG, 100.0f); - - if (!FlagList.empty()) - { - for (std::list<GameObject*>::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) - { - if (despawn) - (*itr)->SetLootState(GO_JUST_DEACTIVATED); - else - (*itr)->Respawn(); - } - } - else - sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: FlagList is empty!"); - } - - void UpdateAI(const uint32 diff) - { - if (SayTimer <= diff) - { - if (EventStarted) - SayTimer = NextStep(Step++); - } - else - SayTimer -= diff; - } - }; - -}; - enum RavegerCage { NPC_DEATH_RAVAGER = 17556, @@ -762,7 +601,6 @@ void AddSC_azuremyst_isle() new npc_engineer_spark_overgrind(); new npc_injured_draenei(); new npc_magwin(); - new npc_geezle(); new npc_death_ravager(); new go_ravager_cage(); new npc_stillpine_capitive(); diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp deleted file mode 100644 index ec098951c03..00000000000 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Boss_Azuregos -SD%Complete: 90 -SDComment: Teleport not included, spell reflect not effecting dots (Core problem) -SDCategory: Azshara -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -enum Say -{ - SAY_TELEPORT = -1000100 -}; - -enum Spells -{ - SPELL_MARKOFFROST = 23182, - SPELL_MANASTORM = 21097, - SPELL_CHILL = 21098, - SPELL_FROSTBREATH = 21099, - SPELL_REFLECT = 22067, - SPELL_CLEAVE = 8255, //Perhaps not right ID - SPELL_ENRAGE = 23537 -}; - -class boss_azuregos : public CreatureScript -{ -public: - boss_azuregos() : CreatureScript("boss_azuregos") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_azuregosAI (creature); - } - - struct boss_azuregosAI : public ScriptedAI - { - boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 MarkOfFrostTimer; - uint32 ManaStormTimer; - uint32 ChillTimer; - uint32 BreathTimer; - uint32 TeleportTimer; - uint32 ReflectTimer; - uint32 CleaveTimer; - uint32 EnrageTimer; - bool Enraged; - - void Reset() - { - MarkOfFrostTimer = 35000; - ManaStormTimer = urand(5000, 17000); - ChillTimer = urand(10000, 30000); - BreathTimer = urand(2000, 8000); - TeleportTimer = 30000; - ReflectTimer = urand(15000, 30000); - CleaveTimer = 7000; - EnrageTimer = 0; - Enraged = false; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (TeleportTimer <= diff) - { - DoScriptText(SAY_TELEPORT, me); - std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList(); - std::list<HostileReference*>::const_iterator i = threatlist.begin(); - for (i = threatlist.begin(); i!= threatlist.end(); ++i) - { - Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); - if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) - { - DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, unit->GetOrientation()); - } - } - - DoResetThreat(); - TeleportTimer = 30000; - } else TeleportTimer -= diff; - - // //MarkOfFrostTimer - // if (MarkOfFrostTimer <= diff) - // { - // DoCast(me->getVictim(), SPELL_MARKOFFROST); - // MarkOfFrostTimer = 25000; - // } else MarkOfFrostTimer -= diff; - - //ChillTimer - if (ChillTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CHILL); - ChillTimer = urand(13000, 25000); - } else ChillTimer -= diff; - - //BreathTimer - if (BreathTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTBREATH); - BreathTimer = urand(10000, 15000); - } else BreathTimer -= diff; - - //ManaStormTimer - if (ManaStormTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_MANASTORM); - ManaStormTimer = urand(7500, 12500); - } else ManaStormTimer -= diff; - - //ReflectTimer - if (ReflectTimer <= diff) - { - DoCast(me, SPELL_REFLECT); - ReflectTimer = urand(20000, 35000); - } else ReflectTimer -= diff; - - //CleaveTimer - if (CleaveTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - CleaveTimer = 7000; - } else CleaveTimer -= diff; - - //EnrageTimer - if (HealthBelowPct(26) && !Enraged) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -void AddSC_boss_azuregos() -{ - new boss_azuregos(); -} diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index 0e02a77169e..3330898ebe4 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -18,15 +18,12 @@ /* ScriptData SDName: Darkshore -SD%Complete: 100 -SDComment: Quest support: 731, 2078, 5321 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Darkshore EndScriptData */ /* ContentData -npc_kerlonian -npc_prospector_remtravel -npc_threshwackonator EndContentData */ #include "ScriptMgr.h" @@ -35,369 +32,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" -/*#### -# npc_kerlonian -####*/ - -enum Kerlonian -{ - SAY_KER_START = -1000434, - - EMOTE_KER_SLEEP_1 = -1000435, - EMOTE_KER_SLEEP_2 = -1000436, - EMOTE_KER_SLEEP_3 = -1000437, - - SAY_KER_SLEEP_1 = -1000438, - SAY_KER_SLEEP_2 = -1000439, - SAY_KER_SLEEP_3 = -1000440, - SAY_KER_SLEEP_4 = -1000441, - - EMOTE_KER_AWAKEN = -1000445, - - SAY_KER_ALERT_1 = -1000442, - SAY_KER_ALERT_2 = -1000443, - - SAY_KER_END = -1000444, - - SPELL_SLEEP_VISUAL = 25148, - SPELL_AWAKEN = 17536, - QUEST_SLEEPER_AWAKENED = 5321, - NPC_LILADRIS = 11219, //attackers entries unknown - FACTION_KER_ESCORTEE = 113 -}; - -//TODO: make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road. -class npc_kerlonian : public CreatureScript -{ -public: - npc_kerlonian() : CreatureScript("npc_kerlonian") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED) - { - if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI())) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_KER_START, creature, player); - pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest); - } - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kerlonianAI(creature); - } - - struct npc_kerlonianAI : public FollowerAI - { - npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } - - uint32 FallAsleepTimer; - - void Reset() - { - FallAsleepTimer = urand(10000, 45000); - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_LILADRIS) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE*5)) - { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me); - - DoScriptText(SAY_KER_END, me); - } - - SetFollowComplete(); - } - } - } - - void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) - { - if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN) - ClearSleeping(); - } - - void SetSleeping() - { - SetFollowPaused(true); - - DoScriptText(RAND(EMOTE_KER_SLEEP_1, EMOTE_KER_SLEEP_2, EMOTE_KER_SLEEP_3), me); - - DoScriptText(RAND(SAY_KER_SLEEP_1, SAY_KER_SLEEP_2, SAY_KER_SLEEP_3, SAY_KER_SLEEP_4), me); - - me->SetStandState(UNIT_STAND_STATE_SLEEP); - DoCast(me, SPELL_SLEEP_VISUAL, false); - } - - void ClearSleeping() - { - me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL); - me->SetStandState(UNIT_STAND_STATE_STAND); - - DoScriptText(EMOTE_KER_AWAKEN, me); - - SetFollowPaused(false); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - if (!HasFollowState(STATE_FOLLOW_INPROGRESS)) - return; - - if (!HasFollowState(STATE_FOLLOW_PAUSED)) - { - if (FallAsleepTimer <= Diff) - { - SetSleeping(); - FallAsleepTimer = urand(25000, 90000); - } - else - FallAsleepTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*#### -# npc_prospector_remtravel -####*/ - -enum Remtravel -{ - SAY_REM_START = -1000327, - SAY_REM_AGGRO = -1000328, - SAY_REM_RAMP1_1 = -1000329, - SAY_REM_RAMP1_2 = -1000330, - SAY_REM_BOOK = -1000331, - SAY_REM_TENT1_1 = -1000332, - SAY_REM_TENT1_2 = -1000333, - SAY_REM_MOSS = -1000334, - EMOTE_REM_MOSS = -1000335, - SAY_REM_MOSS_PROGRESS = -1000336, - SAY_REM_PROGRESS = -1000337, - SAY_REM_REMEMBER = -1000338, - EMOTE_REM_END = -1000339, - - FACTION_ESCORTEE = 10, - QUEST_ABSENT_MINDED_PT2 = 731, - NPC_GRAVEL_SCOUT = 2158, - NPC_GRAVEL_BONE = 2159, - NPC_GRAVEL_GEO = 2160 -}; - -class npc_prospector_remtravel : public CreatureScript -{ -public: - npc_prospector_remtravel() : CreatureScript("npc_prospector_remtravel") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID()); - - creature->setFaction(FACTION_ESCORTEE); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_prospector_remtravelAI(creature); - } - - struct npc_prospector_remtravelAI : public npc_escortAI - { - npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 0: - DoScriptText(SAY_REM_START, me, player); - break; - case 5: - DoScriptText(SAY_REM_RAMP1_1, me, player); - break; - case 6: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - DoScriptText(SAY_REM_RAMP1_2, me, player); - break; - case 14: - //depend quest rewarded? - DoScriptText(SAY_REM_BOOK, me, player); - break; - case 15: - DoScriptText(SAY_REM_TENT1_1, me, player); - break; - case 16: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 17: - DoScriptText(SAY_REM_TENT1_2, me, player); - break; - case 26: - DoScriptText(SAY_REM_MOSS, me, player); - break; - case 27: - DoScriptText(EMOTE_REM_MOSS, me, player); - break; - case 28: - DoScriptText(SAY_REM_MOSS_PROGRESS, me, player); - break; - case 29: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 31: - DoScriptText(SAY_REM_PROGRESS, me, player); - break; - case 41: - DoScriptText(SAY_REM_REMEMBER, me, player); - break; - case 42: - DoScriptText(EMOTE_REM_END, me, player); - player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); - break; - } - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - if (urand(0, 1)) - DoScriptText(SAY_REM_AGGRO, me, who); - } - - void JustSummoned(Creature* /*pSummoned*/) - { - //unsure if it should be any - //pSummoned->AI()->AttackStart(me); - } - }; - -}; - -/*#### -# npc_threshwackonator -####*/ - -enum Threshwackonator -{ - EMOTE_START = -1000325, //signed for 4966 - SAY_AT_CLOSE = -1000326, //signed for 4966 - QUEST_GYROMAST_REV = 2078, - NPC_GELKAK = 6667, - FACTION_HOSTILE = 14 -}; - -#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" - -class npc_threshwackonator : public CreatureScript -{ -public: - npc_threshwackonator() : CreatureScript("npc_threshwackonator") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - - if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI())) - { - DoScriptText(EMOTE_START, creature); - pThreshAI->StartFollow(player); - } - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_threshwackonatorAI(creature); - } - - struct npc_threshwackonatorAI : public FollowerAI - { - npc_threshwackonatorAI(Creature* creature) : FollowerAI(creature) { } - - void Reset() { } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_GELKAK) - { - if (me->IsWithinDistInMap(who, 10.0f)) - { - DoScriptText(SAY_AT_CLOSE, who); - DoAtEnd(); - } - } - } - - void DoAtEnd() - { - me->setFaction(FACTION_HOSTILE); - - if (Player* pHolder = GetLeaderForFollower()) - me->AI()->AttackStart(pHolder); - - SetFollowComplete(); - } - }; - -}; - void AddSC_darkshore() { - new npc_kerlonian(); - new npc_prospector_remtravel(); - new npc_threshwackonator(); } diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index e196c71f681..a3da0019a8b 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -19,14 +19,12 @@ /* ScriptData SDName: Desolace SD%Complete: 100 -SDComment: Quest support: 5561 +SDComment: Quest support: 5561, 5581 SDCategory: Desolace EndScriptData */ /* ContentData npc_aged_dying_ancient_kodo -go_iruxos -npc_dalinda_malem go_demon_portal EndContentData */ @@ -173,104 +171,6 @@ public: }; /*###### -## go_iruxos -## Hand of Iruxos -######*/ - -enum Iruxos -{ - QUEST_HAND_IRUXOS = 5381, - NPC_DEMON_SPIRIT = 11876, -}; - -class go_iruxos : public GameObjectScript -{ - public: - go_iruxos() : GameObjectScript("go_iruxos") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(QUEST_HAND_IRUXOS) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_SPIRIT, 25.0f, true)) - player->SummonCreature(NPC_DEMON_SPIRIT, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - return true; - } -}; - -/*###### -## npc_dalinda_malem. Quest 1440 -######*/ - -enum Dalinda -{ - QUEST_RETURN_TO_VAHLARRIEL = 1440 -}; - -class npc_dalinda : public CreatureScript -{ -public: - npc_dalinda() : CreatureScript("npc_dalinda") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI())) - { - pEscortAI->Start(true, false, player->GetGUID()); - creature->setFaction(113); - } - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_dalindaAI(creature); - } - - struct npc_dalindaAI : public npc_escortAI - { - npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - - switch (waypointId) - { - case 1: - me->IsStandState(); - break; - case 15: - if (player) - player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); - break; - } - } - - void EnterCombat(Unit* /*who*/) { } - - void Reset() {} - - void JustDied(Unit* /*killer*/) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); - return; - } - - void UpdateAI(const uint32 Diff) - { - npc_escortAI::UpdateAI(Diff); - if (!UpdateVictim()) - return; - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### ## go_demon_portal ######*/ @@ -301,7 +201,5 @@ class go_demon_portal : public GameObjectScript void AddSC_desolace() { new npc_aged_dying_ancient_kodo(); - new go_iruxos(); - new npc_dalinda(); new go_demon_portal(); } diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index ec06a542b6f..3c66da1917e 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -17,25 +17,24 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "Vehicle.h" #include "SpellScript.h" /*###### -##Quest 5441: Lazy Peons -##npc_lazy_peon +## Quest 25134: Lazy Peons +## npc_lazy_peon ######*/ enum LazyPeonYells { - SAY_SPELL_HIT = -1000600 //Ow! OK, I''ll get back to work, $N!' + SAY_SPELL_HIT = -1000600 // Ow! OK, I''ll get back to work, $N!' }; enum LazyPeon { - QUEST_LAZY_PEONS = 5441, - GO_LUMBERPILE = 175784, - SPELL_BUFF_SLEEP = 17743, - SPELL_AWAKEN_PEON = 19938 + QUEST_LAZY_PEONS = 25134, + GO_LUMBERPILE = 175784, + SPELL_BUFF_SLEEP = 17743, + SPELL_AWAKEN_PEON = 19938 }; class npc_lazy_peon : public CreatureScript @@ -90,7 +89,7 @@ public: if (RebuffTimer <= Diff) { DoCast(me, SPELL_BUFF_SLEEP); - RebuffTimer = 300000; //Rebuff agian in 5 minutes + RebuffTimer = 300000; //Rebuff agian in 5 minutes } else RebuffTimer -= Diff; @@ -101,431 +100,6 @@ public: }; }; -enum Texts -{ - // Tiger Matriarch Credit - SAY_MATRIARCH_AGGRO = 0, - - // Troll Volunteer - SAY_VOLUNTEER_START = 0, - SAY_VOLUNTEER_END = 1, -}; - -enum Spells -{ - // Tiger Matriarch Credit - SPELL_SUMMON_MATRIARCH = 75187, - SPELL_NO_SUMMON_AURA = 75213, - SPELL_DETECT_INVIS = 75180, - SPELL_SUMMON_ZENTABRA_TRIGGER = 75212, - - // Tiger Matriarch - SPELL_POUNCE = 61184, - SPELL_FURIOUS_BITE = 75164, - SPELL_SUMMON_ZENTABRA = 75181, - SPELL_SPIRIT_OF_THE_TIGER_RIDER = 75166, - SPELL_EJECT_PASSENGERS = 50630, - - // Troll Volunteer - SPELL_VOLUNTEER_AURA = 75076, - SPELL_PETACT_AURA = 74071, - SPELL_QUEST_CREDIT = 75106, - SPELL_MOUNTING_CHECK = 75420, - SPELL_TURNIN = 73953, - SPELL_AOE_TURNIN = 75107, - - // Vol'jin War Drums - SPELL_MOTIVATE_1 = 75088, - SPELL_MOTIVATE_2 = 75086, -}; - -enum Creatures -{ - // Tiger Matriarch Credit - NPC_TIGER_VEHICLE = 40305, - - // Troll Volunteer - NPC_URUZIN = 40253, - NPC_VOLUNTEER_1 = 40264, - NPC_VOLUNTEER_2 = 40260, - - // Vol'jin War Drums - NPC_CITIZEN_1 = 40256, - NPC_CITIZEN_2 = 40257, -}; - -enum Events -{ - // Tiger Matriarch Credit - EVENT_CHECK_SUMMON_AURA = 1, - - // Tiger Matriarch - EVENT_POUNCE = 2, - EVENT_NOSUMMON = 3, -}; - -enum Points -{ - POINT_URUZIN = 4026400, -}; - -class npc_tiger_matriarch_credit : public CreatureScript -{ - public: - npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { } - - struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI - { - npc_tiger_matriarch_creditAI(Creature* creature) : Scripted_NoMovementAI(creature) - { - events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000); - } - - void UpdateAI(uint32 const diff) - { - events.Update(diff); - - if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA) - { - std::list<Creature*> tigers; - GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f); - if (!tigers.empty()) - { - for (std::list<Creature*>::iterator itr = tigers.begin(); itr != tigers.end(); ++itr) - { - if (!(*itr)->isSummon()) - continue; - - if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner()) - if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER) - && !summoner->isInCombat()) - { - me->AddAura(SPELL_NO_SUMMON_AURA, summoner); - me->AddAura(SPELL_DETECT_INVIS, summoner); - summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true); - Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID()); - } - } - } - - events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000); - } - } - - private: - EventMap events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tiger_matriarch_creditAI(creature); - } -}; - -class npc_tiger_matriarch : public CreatureScript -{ - public: - npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") {} - - struct npc_tiger_matriarchAI : public ScriptedAI - { - npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature), - _tigerGuid(0) - { - } - - void EnterCombat(Unit* /*target*/) - { - _events.Reset(); - _events.ScheduleEvent(EVENT_POUNCE, 100); - _events.ScheduleEvent(EVENT_NOSUMMON, 50000); - } - - void IsSummonedBy(Unit* summoner) - { - if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle()) - return; - - _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID(); - if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) - { - me->AddThreat(tiger, 500000.0f); - DoCast(me, SPELL_FURIOUS_BITE); - } - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() != TYPEID_UNIT || !victim->isSummon()) - return; - - if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner()) - { - vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); - vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); - vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); - vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); - } - me->DespawnOrUnsummon(); - } - - void DamageTaken(Unit* attacker, uint32& damage) - { - if (!attacker->isSummon()) - return; - - if (HealthBelowPct(20)) - { - damage = 0; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner()) - { - vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner); - vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true); - attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true); - vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); - vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); - vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); - vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); - } - - me->DespawnOrUnsummon(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!_tigerGuid) - return; - - _events.Update(diff); - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_POUNCE: - DoCastVictim(SPELL_POUNCE); - _events.ScheduleEvent(EVENT_POUNCE, 30000); - break; - case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA - if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) - { - if (tiger->isSummon()) - if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner()) - me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); - } - _events.ScheduleEvent(EVENT_NOSUMMON, 50000); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap _events; - uint64 _tigerGuid; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tiger_matriarchAI(creature); - } -}; - -// These models was found in sniff. -// TODO: generalize these models with race from dbc -uint32 const trollmodel[] = -{11665, 11734, 11750, 12037, 12038, 12042, 12049, 12849, 13529, 14759, 15570, 15701, -15702, 1882, 1897, 1976, 2025, 27286, 2734, 2735, 4084, 4085, 4087, 4089, 4231, 4357, -4358, 4360, 4361, 4362, 4363, 4370, 4532, 4537, 4540, 4610, 6839, 7037, 9767, 9768}; - -class npc_troll_volunteer : public CreatureScript -{ - public: - npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { } - - struct npc_troll_volunteerAI : public ScriptedAI - { - npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) - { - } - - void InitializeAI() - { - if (me->isDead() || !me->GetOwner()) - return; - - Reset(); - - switch (urand(0, 3)) - { - case 0: - _mountModel = 6471; - break; - case 1: - _mountModel = 6473; - break; - case 2: - _mountModel = 6469; - break; - default: - _mountModel = 6472; - break; - } - me->SetDisplayId(trollmodel[urand(0, 39)]); - if (Player* player = me->GetOwner()->ToPlayer()) - me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f); - } - - void Reset() - { - _complete = false; - me->AddAura(SPELL_VOLUNTEER_AURA, me); - me->AddAura(SPELL_MOUNTING_CHECK, me); - DoCast(me, SPELL_PETACT_AURA); - me->SetReactState(REACT_PASSIVE); - Talk(SAY_VOLUNTEER_START); - } - - // This is needed for mount check aura to know what mountmodel the npc got stored - uint32 GetMountId() - { - return _mountModel; - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - if (id == POINT_URUZIN) - me->DespawnOrUnsummon(); - } - - void SpellHit(Unit* caster, SpellInfo const* spell) - { - if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete) - { - _complete = true; // Preventing from giving credit twice - DoCast(me, SPELL_TURNIN); - DoCast(me, SPELL_QUEST_CREDIT); - me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK); - me->Dismount(); - Talk(SAY_VOLUNTEER_END); - me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ()); - } - } - - private: - uint32 _mountModel; - bool _complete; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_troll_volunteerAI(creature); - } -}; - -typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI; - -class spell_mount_check : public SpellScriptLoader -{ - public: - spell_mount_check() : SpellScriptLoader("spell_mount_check") {} - - class spell_mount_check_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mount_check_AuraScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK)) - return false; - return true; - } - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - Unit* target = GetTarget(); - Unit* owner = target->GetOwner(); - - if (!owner) - return; - - if (owner->IsMounted() && !target->IsMounted()) - { - if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI())) - target->Mount(volunteerAI->GetMountId()); - } - else if (!owner->IsMounted() && target->IsMounted()) - target->Dismount(); - - target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN)); - target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK)); - } - - void Register() - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mount_check_AuraScript(); - } -}; - -class spell_voljin_war_drums : public SpellScriptLoader -{ - public: - spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") {} - - class spell_voljin_war_drums_SpellScript : public SpellScript - { - PrepareSpellScript(spell_voljin_war_drums_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) - { - uint32 motivate = 0; - if (target->GetEntry() == NPC_CITIZEN_1) - motivate = SPELL_MOTIVATE_1; - else if (target->GetEntry() == NPC_CITIZEN_2) - motivate = SPELL_MOTIVATE_2; - if (motivate) - caster->CastSpell(target, motivate, false); - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_voljin_war_drums_SpellScript(); - } -}; - enum VoodooSpells { SPELL_BREW = 16712, // Special Brew @@ -545,9 +119,9 @@ class spell_voodoo : public SpellScriptLoader class spell_voodoo_SpellScript : public SpellScript { - PrepareSpellScript(spell_voodoo_SpellScript) + PrepareSpellScript(spell_voodoo_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) || !sSpellMgr->GetSpellInfo(SPELL_HEX1) || !sSpellMgr->GetSpellInfo(SPELL_HEX2) || @@ -579,10 +153,5 @@ class spell_voodoo : public SpellScriptLoader void AddSC_durotar() { new npc_lazy_peon(); - new npc_tiger_matriarch_credit(); - new npc_tiger_matriarch(); - new npc_troll_volunteer(); - new spell_mount_check(); - new spell_voljin_war_drums(); new spell_voodoo(); } diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 5800a6a58a0..c2953ba38ef 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -19,16 +19,13 @@ /* ScriptData SDName: Dustwallow_Marsh SD%Complete: 95 -SDComment: Quest support: 11180, 558, 11126, 11142, 11174, Vendor Nat Pagle +SDComment: Quest support: 1270, 1222, 27245 SDCategory: Dustwallow Marsh EndScriptData */ /* ContentData -mobs_risen_husk_spirit -npc_lady_jaina_proudmoore -npc_nat_pagle -npc_private_hendel -npc_cassa_crimsonwing - handled by npc_taxi +npc_stinky +go_blackhoof_cage EndContentData */ #include "ScriptMgr.h" @@ -38,443 +35,6 @@ EndContentData */ #include "SpellScript.h" /*###### -## mobs_risen_husk_spirit -######*/ - -enum HauntingWitchHill -{ - // Quest - QUEST_WHATS_HAUNTING_WITCH_HILL = 11180, - - // General spells - SPELL_SUMMON_RESTLESS_APPARITION = 42511, - SPELL_WITCH_HILL_INFORMATION_CREDIT = 42512, - - // Risen Husk specific - SPELL_CONSUME_FLESH = 37933, - NPC_RISEN_HUSK = 23555, - - // Risen Spirit specific - SPELL_INTANGIBLE_PRESENCE = 43127, - NPC_RISEN_SPIRIT = 23554, - - // Events - EVENT_CONSUME_FLESH = 0, - EVENT_INTANGIBLE_PRESENCE = 1, -}; - -class mobs_risen_husk_spirit : public CreatureScript -{ - public: - mobs_risen_husk_spirit() : CreatureScript("mobs_risen_husk_spirit") { } - - struct mobs_risen_husk_spiritAI : public ScriptedAI - { - mobs_risen_husk_spiritAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() - { - events.Reset(); - if (me->GetEntry() == NPC_RISEN_HUSK) - events.ScheduleEvent(EVENT_CONSUME_FLESH, 5000); - else if (me->GetEntry() == NPC_RISEN_SPIRIT) - events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 5000); - } - - void JustDied(Unit* killer) - { - if (killer->GetTypeId() == TYPEID_PLAYER) - { - if (killer->ToPlayer()->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE) - { - DoCast(me, SPELL_SUMMON_RESTLESS_APPARITION, true); - DoCast(killer, SPELL_WITCH_HILL_INFORMATION_CREDIT, true); - } - } - } - - void UpdateAI(uint32 const diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_CONSUME_FLESH: - DoCastVictim(SPELL_CONSUME_FLESH); - events.ScheduleEvent(EVENT_CONSUME_FLESH, 15000); - break; - case EVENT_INTANGIBLE_PRESENCE: - DoCastVictim(SPELL_INTANGIBLE_PRESENCE); - events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 15000); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_risen_husk_spiritAI (creature); - } -}; - -/*###### -## npc_theramor_guard -######*/ - -enum TheramoreGuard -{ - SAY_QUEST1 = -1000641, - SAY_QUEST2 = -1000642, - SAY_QUEST3 = -1000643, - SAY_QUEST4 = -1000644, - SAY_QUEST5 = -1000645, - SAY_QUEST6 = -1000646, - SAY_QUEST7 = -1000647, - SAY_QUEST8 = -1000648, - SAY_QUEST9 = -1000649, - - QUEST_DISCREDITING_THE_DESERTERS = 11133, - - NPC_THERAMORE_GUARD = 4979, - - SPELL_DOCTORED_LEAFLET = 42725, - SPELL_PROPAGANDIZED = 42246, -}; - -#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?" - -class npc_theramore_guard : public CreatureScript -{ -public: - npc_theramore_guard() : CreatureScript("npc_theramore_guard") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - - if (action == GOSSIP_SENDER_INFO) - { - player->CLOSE_GOSSIP_MENU(); - player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); - DoScriptText(SAY_QUEST1, creature); - creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); - creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_theramore_guardAI(creature); - } - - struct npc_theramore_guardAI : public ScriptedAI - { - npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 YellTimer; - uint32 Step; - bool bYellTimer; - - void Reset() - { - bYellTimer = false; - Step = 0; - } - - void UpdateAI(const uint32 Diff) - { - if (!me->HasAura(SPELL_PROPAGANDIZED)) - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - if (bYellTimer && YellTimer <= Diff) - { - switch (Step) - { - case 0: - DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me); - YellTimer = 3000; - ++Step; - break; - case 1: - DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - Step = 0; - bYellTimer = false; - break; - } - } - else - YellTimer -= Diff; - } - }; -}; - -/*###### -## npc_lady_jaina_proudmoore -######*/ - -enum LadyJaina -{ - QUEST_JAINAS_AUTOGRAPH = 558, - SPELL_JAINAS_AUTOGRAPH = 23122 -}; - -#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." - -class npc_lady_jaina_proudmoore : public CreatureScript -{ -public: - npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_SENDER_INFO) - { - player->SEND_GOSSIP_MENU(7012, creature->GetGUID()); - player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_nat_pagle -######*/ - -enum NatPagle -{ - QUEST_NATS_MEASURING_TAPE = 8227 -}; - -class npc_nat_pagle : public CreatureScript -{ -public: - npc_nat_pagle() : CreatureScript("npc_nat_pagle") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - player->SEND_GOSSIP_MENU(7640, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(7638, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_private_hendel -######*/ - -enum Hendel -{ - // looks like all this text ids are wrong. - SAY_PROGRESS_1_TER = -1000411, // signed for 3568 - SAY_PROGRESS_2_HEN = -1000412, // signed for 3568 - SAY_PROGRESS_3_TER = -1000413, - SAY_PROGRESS_4_TER = -1000414, - EMOTE_SURRENDER = -1000415, - - QUEST_MISSING_DIPLO_PT16 = 1324, - FACTION_HOSTILE = 168, //guessed, may be different - - NPC_SENTRY = 5184, //helps hendel - NPC_JAINA = 4968, //appears once hendel gives up - NPC_TERVOSH = 4967 -}; - -//TODO: develop this further, end event not created -class npc_private_hendel : public CreatureScript -{ -public: - npc_private_hendel() : CreatureScript("npc_private_hendel") { } - - bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) - creature->setFaction(FACTION_HOSTILE); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_private_hendelAI(creature); - } - - struct npc_private_hendelAI : public ScriptedAI - { - npc_private_hendelAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() - { - me->RestoreFaction(); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &Damage) - { - if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage)) - { - Damage = 0; - - if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) - player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me); - - DoScriptText(EMOTE_SURRENDER, me); - EnterEvadeMode(); - } - } - }; - -}; - -/*###### -## npc_zelfrax -######*/ - -Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; - -enum Zelfrax -{ - SAY_ZELFRAX = -1000472, - SAY_ZELFRAX_2 = -1000473 -}; - -class npc_zelfrax : public CreatureScript -{ -public: - npc_zelfrax() : CreatureScript("npc_zelfrax") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_zelfraxAI(creature); - } - - struct npc_zelfraxAI : public ScriptedAI - { - npc_zelfraxAI(Creature* creature) : ScriptedAI(creature) - { - MoveToDock(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (me->Attack(who, true)) - { - me->SetInCombatWith(who); - who->SetInCombatWith(me); - - if (IsCombatMovementAllowed()) - me->GetMotionMaster()->MoveChase(who); - } - } - - void MovementInform(uint32 Type, uint32 /*Id*/) - { - if (Type != POINT_MOTION_TYPE) - return; - - me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - SetCombatMovement(true); - - if (me->isInCombat()) - if (Unit* unit = me->getVictim()) - me->GetMotionMaster()->MoveChase(unit); - } - - void MoveToDock() - { - SetCombatMovement(false); - me->GetMotionMaster()->MovePoint(0, MovePosition); - DoScriptText(SAY_ZELFRAX, me); - DoScriptText(SAY_ZELFRAX_2, me); - } - - void UpdateAI(uint32 const /*Diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### ## npc_stinky ######*/ @@ -771,13 +331,7 @@ public: void AddSC_dustwallow_marsh() { - new mobs_risen_husk_spirit(); - new npc_lady_jaina_proudmoore(); - new npc_nat_pagle(); - new npc_private_hendel(); - new npc_zelfrax(); new npc_stinky(); - new npc_theramore_guard(); new spell_ooze_zap(); new spell_ooze_zap_channel_end(); new spell_energize_aoe(); diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index 1a0aa7b21c0..1d504c02149 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -19,87 +19,17 @@ /* ScriptData SDName: Felwood SD%Complete: 95 -SDComment: Quest support: 4101, 4102 +SDComment: Quest support: SDCategory: Felwood EndScriptData */ /* ContentData -npcs_riverbreeze_and_silversky EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npcs_riverbreeze_and_silversky -######*/ - -#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" - -enum RiverbreezeAndSilversky -{ - SPELL_CENARION_BEACON = 15120, - - NPC_ARATHANDRIS_SILVERSKY = 9528, - NPC_MAYBESS_RIVERBREEZE = 9529, - - QUEST_CLEASING_FELWOOD_A = 4101, - QUEST_CLEASING_FELWOOD_H = 4102 -}; - -class npcs_riverbreeze_and_silversky : public CreatureScript -{ -public: - npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_CENARION_BEACON, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - uint32 creatureId = creature->GetEntry(); - - if (creatureId == NPC_ARATHANDRIS_SILVERSKY) - { - if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(2848, creature->GetGUID()); - } else if (player->GetTeam() == HORDE) - player->SEND_GOSSIP_MENU(2845, creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); - } - - if (creatureId == NPC_MAYBESS_RIVERBREEZE) - { - if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(2849, creature->GetGUID()); - } else if (player->GetTeam() == ALLIANCE) - player->SEND_GOSSIP_MENU(2843, creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2842, creature->GetGUID()); - } - - return true; - } -}; - void AddSC_felwood() { - new npcs_riverbreeze_and_silversky(); } diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 4fcd20951c9..79aa25cea71 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -18,8 +18,8 @@ /* ScriptData SDName: Feralas -SD%Complete: 100 -SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer +SD%Complete: 0 +SDComment: Quest support: SDCategory: Feralas EndScriptData */ @@ -28,187 +28,6 @@ EndScriptData */ #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" -/*###### -## npc_gregan_brewspewer -######*/ - -#define GOSSIP_HELLO "Buy somethin', will ya?" - -class npc_gregan_brewspewer : public CreatureScript -{ -public: - npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - player->SEND_GOSSIP_MENU(2434, creature->GetGUID()); - } - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(2433, creature->GetGUID()); - return true; - } - -}; - -/*###### -## npc_oox22fe -######*/ - -enum OOX -{ - //signed for 7806 - SAY_OOX_START = -1000287, - SAY_OOX_AGGRO1 = -1000288, - SAY_OOX_AGGRO2 = -1000289, - SAY_OOX_AMBUSH = -1000290, - SAY_OOX_END = -1000292, - - NPC_YETI = 7848, - NPC_GORILLA = 5260, - NPC_WOODPAW_REAVER = 5255, - NPC_WOODPAW_BRUTE = 5253, - NPC_WOODPAW_ALPHA = 5258, - NPC_WOODPAW_MYSTIC = 5254, - - QUEST_RESCUE_OOX22FE = 2767, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 -}; - -class npc_oox22fe : public CreatureScript -{ -public: - npc_oox22fe() : CreatureScript("npc_oox22fe") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RESCUE_OOX22FE) - { - DoScriptText(SAY_OOX_START, creature); - //change that the npc is not lying dead on the ground - creature->SetStandState(UNIT_STAND_STATE_STAND); - - if (player->GetTeam() == ALLIANCE) - creature->setFaction(FACTION_ESCORTEE_A); - - if (player->GetTeam() == HORDE) - creature->setFaction(FACTION_ESCORTEE_H); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22fe::npc_oox22feAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_oox22feAI(creature); - } - - struct npc_oox22feAI : public npc_escortAI - { - npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - // First Ambush(3 Yetis) - case 11: - DoScriptText(SAY_OOX_AMBUSH, me); - me->SummonCreature(NPC_YETI, -4841.01f, 1593.91f, 73.42f, 3.98f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_YETI, -4837.61f, 1568.58f, 78.21f, 3.13f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_YETI, -4841.89f, 1569.95f, 76.53f, 0.68f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Second Ambush(3 Gorillas) - case 21: - DoScriptText(SAY_OOX_AMBUSH, me); - me->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Third Ambush(4 Gnolls) - case 30: - DoScriptText(SAY_OOX_AMBUSH, me); - me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14f, 2075.87f, 47.77f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_BRUTE, -4426.68f, 2077.98f, 47.57f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33f, 2080.24f, 47.43f, 3.87f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_ALPHA, -4430.04f, 2075.54f, 46.83f, 3.81f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - case 37: - DoScriptText(SAY_OOX_END, me); - // Award quest credit - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); - break; - } - } - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - me->SetStandState(UNIT_STAND_STATE_DEAD); - } - - void EnterCombat(Unit* /*who*/) - { - //For an small probability the npc says something when he get aggro - if (urand(0, 9) > 7) - DoScriptText(RAND(SAY_OOX_AGGRO1, SAY_OOX_AGGRO2), me); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - }; - -}; - -/*###### -## npc_screecher_spirit -######*/ - -class npc_screecher_spirit : public CreatureScript -{ -public: - npc_screecher_spirit() : CreatureScript("npc_screecher_spirit") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - player->SEND_GOSSIP_MENU(2039, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - return true; - } - -}; - -/*###### -## AddSC -######*/ - void AddSC_feralas() { - new npc_gregan_brewspewer(); - new npc_oox22fe(); - new npc_screecher_spirit(); } diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 3c8d2267903..3afed715c09 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -18,17 +18,13 @@ /* ScriptData SDName: Moonglade -SD%Complete: 100 -SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class. +SD%Complete: 0 +SDComment: Quest support: SDCategory: Moonglade EndScriptData */ /* ContentData -npc_bunthen_plainswind -npc_great_bear_spirit -npc_silva_filnaveth -npc_clintar_spirit -npc_clintar_dreamwalker +npc_omen EndContentData */ #include "ScriptMgr.h" @@ -36,539 +32,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" -/*###### -## npc_bunthen_plainswind -######*/ - -enum Bunthen -{ - QUEST_SEA_LION_HORDE = 30, - QUEST_SEA_LION_ALLY = 272, - TAXI_PATH_ID_ALLY = 315, - TAXI_PATH_ID_HORDE = 316 -}; - -#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff." -#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?" - -class npc_bunthen_plainswind : public CreatureScript -{ -public: - npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) - player->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_GOSSIP_MENU(5373, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(5376, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->getClass() != CLASS_DRUID) - player->SEND_GOSSIP_MENU(4916, creature->GetGUID()); - else if (player->GetTeam() != HORDE) - { - if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(4917, creature->GetGUID()); - } - else if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - player->SEND_GOSSIP_MENU(4918, creature->GetGUID()); - } - return true; - } - -}; - -/*###### -## npc_great_bear_spirit -######*/ - -#define GOSSIP_BEAR1 "What do you represent, spirit?" -#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." -#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." -#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." - -class npc_great_bear_spirit : public CreatureScript -{ -public: - npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(4721, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(4733, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(4734, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(4735, creature->GetGUID()); - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5929); - if (player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5930); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - //ally or horde quest - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(4719, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(4718, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_silva_filnaveth -######*/ - -#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village." -#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?" - -class npc_silva_filnaveth : public CreatureScript -{ -public: - npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) - player->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_GOSSIP_MENU(5374, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(5375, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->getClass() != CLASS_DRUID) - player->SEND_GOSSIP_MENU(4913, creature->GetGUID()); - else if (player->GetTeam() != ALLIANCE) - { - if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(4915, creature->GetGUID()); - } - else if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - player->SEND_GOSSIP_MENU(4914, creature->GetGUID()); - } - return true; - } - -}; - -/*###### -## npc_clintar_spirit -######*/ - -float const Clintar_spirit_WP[41][5] = -{ - //pos_x pos_y pos_z orien waitTime - {7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, - {7476.49f, -3101, 443.457f, 0.89f, 0}, - {7486.57f, -3085.59f, 439.478f, 1.07f, 0}, - {7472.19f, -3085.06f, 443.142f, 3.07f, 0}, - {7456.92f, -3085.91f, 438.862f, 3.24f, 0}, - {7446.68f, -3083.43f, 438.245f, 2.40f, 0}, - {7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, - {7452.41f, -3085.8f, 438.984f, 5.78f, 0}, - {7469.11f, -3084.94f, 443.048f, 6.25f, 0}, - {7483.79f, -3085.44f, 439.607f, 6.25f, 0}, - {7491.14f, -3090.96f, 439.983f, 5.44f, 0}, - {7497.62f, -3098.22f, 436.854f, 5.44f, 0}, - {7498.72f, -3113.41f, 434.596f, 4.84f, 0}, - {7500.06f, -3122.51f, 434.749f, 5.17f, 0}, - {7504.96f, -3131.53f, 434.475f, 4.74f, 0}, - {7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, - {7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, - {7501.99f, -3126.01f, 434.93f, 1.83f, 0}, - {7490.76f, -3114.97f, 434.431f, 2.51f, 0}, - {7479.64f, -3105.51f, 431.123f, 1.83f, 0}, - {7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, - {7472.96f, -3074.18f, 427.566f, 1.57f, 0}, - {7472.25f, -3063, 428.268f, 1.55f, 0}, - {7473.46f, -3054.22f, 427.588f, 0.36f, 0}, - {7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, - {7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, - {7471.81f, -3058.84f, 427.073f, 4.29f, 0}, - {7472.16f, -3064.91f, 427.772f, 4.95f, 0}, - {7471.56f, -3085.36f, 428.924f, 4.72f, 0}, - {7473.56f, -3093.48f, 429.294f, 5.04f, 0}, - {7478.94f, -3104.29f, 430.638f, 5.23f, 0}, - {7484.46f, -3109.61f, 432.769f, 5.79f, 0}, - {7490.23f, -3111.08f, 434.431f, 0.02f, 0}, - {7496.29f, -3108, 434.783f, 1.15f, 0}, - {7497.46f, -3100.66f, 436.191f, 1.50f, 0}, - {7495.64f, -3093.39f, 438.349f, 2.10f, 0}, - {7492.44f, -3086.01f, 440.267f, 1.38f, 0}, - {7498.26f, -3076.44f, 440.808f, 0.71f, 0}, - {7506.4f, -3067.35f, 443.64f, 0.77f, 0}, - {7518.37f, -3057.42f, 445.584f, 0.74f, 0}, - {7517.51f, -3056.3f, 444.568f, 2.49f, 4500} -}; - -Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f}; -Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f}; - -enum ClintarSpirit -{ - ASPECT_RAVEN = 22915, - - //from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong. - CLINTAR_SPIRIT_SAY_START = -1000286, - CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 = -1000287, - CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 = -1000288, - CLINTAR_SPIRIT_SAY_GET_ONE = -1000289, - CLINTAR_SPIRIT_SAY_GET_TWO = -1000290, - CLINTAR_SPIRIT_SAY_GET_THREE = -1000291, - CLINTAR_SPIRIT_SAY_GET_FINAL = -1000292 -}; - -class npc_clintar_spirit : public CreatureScript -{ -public: - npc_clintar_spirit() : CreatureScript("npc_clintar_spirit") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_clintar_spiritAI (creature); - } - - struct npc_clintar_spiritAI : public npc_escortAI - { - public: - npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) - { - PlayerGUID = 0; - } - - uint8 Step; - uint32 CurrWP; - uint32 EventTimer; - uint32 checkPlayerTimer; - - uint64 PlayerGUID; - - bool EventOnWait; - - void Reset() - { - if (!PlayerGUID) - { - Step = 0; - CurrWP = 0; - EventTimer = 0; - PlayerGUID = 0; - checkPlayerTimer = 1000; - EventOnWait = false; - } - } - - void JustDied(Unit* /*killer*/) - { - if (!PlayerGUID) - return; - - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - player->FailQuest(10965); - PlayerGUID = 0; - Reset(); - } - } - - void EnterEvadeMode() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->isInCombat() && player->getAttackerForHelper()) - { - AttackStart(player->getAttackerForHelper()); - return; - } - npc_escortAI::EnterEvadeMode(); - } - - void EnterCombat(Unit* who) - { - switch (urand(0, 1)) - { - case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break; - case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break; - } - } - - void StartEvent(Player* player) - { - if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - for (uint8 i = 0; i < 41; ++i) - { - AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); - } - PlayerGUID = player->GetGUID(); - Start(true, false, PlayerGUID); - } - return; - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!PlayerGUID) - { - me->setDeathState(JUST_DIED); - return; - } - - if (!me->isInCombat() && !EventOnWait) - { - if (checkPlayerTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->isInCombat() && player->getAttackerForHelper()) - AttackStart(player->getAttackerForHelper()); - checkPlayerTimer = 1000; - } else checkPlayerTimer -= diff; - } - - if (EventOnWait && EventTimer <= diff) - { - - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player || (player && player->GetQuestStatus(10965) == QUEST_STATUS_NONE)) - { - me->setDeathState(JUST_DIED); - return; - } - - switch (CurrWP) - { - case 0: - switch (Step) - { - case 0: - me->Say(CLINTAR_SPIRIT_SAY_START, 0, PlayerGUID); - EventTimer = 8000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 6: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, player); - EventOnWait = false; - break; - } - break; - case 15: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventOnWait = false; - break; - } - break; - case 16: - switch (Step) - { - case 0: - DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, player); - EventTimer = 15000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 20: - switch (Step) - { - case 0: - if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) - { - mob->AddThreat(me, 10000.0f); - mob->AI()->AttackStart(me); - } - EventTimer = 2000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 24: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventOnWait = false; - break; - } - break; - case 25: - switch (Step) - { - case 0: - DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, player); - EventTimer = 4000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 40: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); - DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, player); - player->CompleteQuest(10965); - EventTimer = 1500; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventTimer = 3000; - Step = 2; - break; - case 2: - player->TalkedToCreature(me->GetEntry(), me->GetGUID()); - PlayerGUID = 0; - Reset(); - me->setDeathState(JUST_DIED); - break; - } - break; - default: - EventOnWait = false; - break; - } - - } else if (EventOnWait) EventTimer -= diff; - } - - void WaypointReached(uint32 waypointId) - { - CurrWP = waypointId; - EventTimer = 0; - Step = 0; - EventOnWait = true; - } - }; - -}; - -/*#### -# npc_clintar_dreamwalker -####*/ - -enum Clintar -{ - CLINTAR_SPIRIT = 22916 -}; - -class npc_clintar_dreamwalker : public CreatureScript -{ -public: - npc_clintar_dreamwalker() : CreatureScript("npc_clintar_dreamwalker") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == 10965) - if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000)) - CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); - return true; - } - -}; - /*#### # npc_omen ####*/ @@ -717,11 +180,6 @@ public: void AddSC_moonglade() { - new npc_bunthen_plainswind(); - new npc_great_bear_spirit(); - new npc_silva_filnaveth(); - new npc_clintar_dreamwalker(); - new npc_clintar_spirit(); new npc_omen(); new npc_giant_spotlight(); } diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index 5b35688c2b8..9aea03de09d 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -19,14 +19,13 @@ /* ScriptData SDName: Mulgore SD%Complete: 100 -SDComment: Support for quest: 11129, 772 +SDComment: Support for quest: 11129, 861 SDCategory: Mulgore EndScriptData */ /* ContentData npc_skorn_whitecloud npc_kyle_frenzied -npc_plains_vision EndContentData */ #include "ScriptMgr.h" @@ -200,127 +199,8 @@ public: }; -/*##### -# npc_plains_vision -######*/ - -Position const wpPlainVision[50] = -{ - {-2226.32f, -408.095f, -9.36235f, 0.0f}, - {-2203.04f, -437.212f, -5.72498f, 0.0f}, - {-2163.91f, -457.851f, -7.09049f, 0.0f}, - {-2123.87f, -448.137f, -9.29591f, 0.0f}, - {-2104.66f, -427.166f, -6.49513f, 0.0f}, - {-2101.48f, -422.826f, -5.3567f, 0.0f}, - {-2097.56f, -417.083f, -7.16716f, 0.0f}, - {-2084.87f, -398.626f, -9.88973f, 0.0f}, - {-2072.71f, -382.324f, -10.2488f, 0.0f}, - {-2054.05f, -356.728f, -6.22468f, 0.0f}, - {-2051.8f, -353.645f, -5.35791f, 0.0f}, - {-2049.08f, -349.912f, -6.15723f, 0.0f}, - {-2030.6f, -310.724f, -9.59302f, 0.0f}, - {-2002.15f, -249.308f, -10.8124f, 0.0f}, - {-1972.85f, -195.811f, -10.6316f, 0.0f}, - {-1940.93f, -147.652f, -11.7055f, 0.0f}, - {-1888.06f, -81.943f, -11.4404f, 0.0f}, - {-1837.05f, -34.0109f, -12.258f, 0.0f}, - {-1796.12f, -14.6462f, -10.3581f, 0.0f}, - {-1732.61f, -4.27746f, -10.0213f, 0.0f}, - {-1688.94f, -0.829945f, -11.7103f, 0.0f}, - {-1681.32f, 13.0313f, -9.48056f, 0.0f}, - {-1677.04f, 36.8349f, -7.10318f, 0.0f}, - {-1675.2f, 68.559f, -8.95384f, 0.0f}, - {-1676.57f, 89.023f, -9.65104f, 0.0f}, - {-1678.16f, 110.939f, -10.1782f, 0.0f}, - {-1677.86f, 128.681f, -5.73869f, 0.0f}, - {-1675.27f, 144.324f, -3.47916f, 0.0f}, - {-1671.7f, 163.169f, -1.23098f, 0.0f}, - {-1666.61f, 181.584f, 5.26145f, 0.0f}, - {-1661.51f, 196.154f, 8.95252f, 0.0f}, - {-1655.47f, 210.811f, 8.38727f, 0.0f}, - {-1647.07f, 226.947f, 5.27755f, 0.0f}, - {-1621.65f, 232.91f, 2.69579f, 0.0f}, - {-1600.23f, 237.641f, 2.98539f, 0.0f}, - {-1576.07f, 242.546f, 4.66541f, 0.0f}, - {-1554.57f, 248.494f, 6.60377f, 0.0f}, - {-1547.53f, 259.302f, 10.6741f, 0.0f}, - {-1541.7f, 269.847f, 16.4418f, 0.0f}, - {-1539.83f, 278.989f, 21.0597f, 0.0f}, - {-1540.16f, 290.219f, 27.8247f, 0.0f}, - {-1538.99f, 298.983f, 34.0032f, 0.0f}, - {-1540.38f, 307.337f, 41.3557f, 0.0f}, - {-1536.61f, 314.884f, 48.0179f, 0.0f}, - {-1532.42f, 323.277f, 55.6667f, 0.0f}, - {-1528.77f, 329.774f, 61.1525f, 0.0f}, - {-1525.65f, 333.18f, 63.2161f, 0.0f}, - {-1517.01f, 350.713f, 62.4286f, 0.0f}, - {-1511.39f, 362.537f, 62.4539f, 0.0f}, - {-1508.68f, 366.822f, 62.733f, 0.0f} -}; - -class npc_plains_vision : public CreatureScript -{ -public: - npc_plains_vision() : CreatureScript("npc_plains_vision") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_plains_visionAI (creature); - } - - struct npc_plains_visionAI : public ScriptedAI - { - npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) {} - - bool newWaypoint; - uint8 WayPointId; - uint8 amountWP; - - void Reset() - { - WayPointId = 0; - newWaypoint = true; - amountWP = 49; - } - - void EnterCombat(Unit* /*who*/){} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id < amountWP) - { - ++WayPointId; - newWaypoint = true; - } - else - { - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (newWaypoint) - { - me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]); - newWaypoint = false; - } - } - }; - -}; - -/*##### -# -######*/ - void AddSC_mulgore() { new npc_skorn_whitecloud(); new npc_kyle_frenzied(); - new npc_plains_vision(); } diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index fca8d0f5fc5..48f0396c5fb 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -18,236 +18,18 @@ /* ScriptData SDName: Orgrimmar -SD%Complete: 100 -SDComment: Quest support: 2460, 6566 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Orgrimmar EndScriptData */ /* ContentData -npc_shenthul -npc_thrall_warchief EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_shenthul -######*/ - -enum Shenthul -{ - QUEST_SHATTERED_SALUTE = 2460 -}; - -class npc_shenthul : public CreatureScript -{ -public: - npc_shenthul() : CreatureScript("npc_shenthul") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE) - { - CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->CanTalk = true; - CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->PlayerGUID = player->GetGUID(); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_shenthulAI (creature); - } - - struct npc_shenthulAI : public ScriptedAI - { - npc_shenthulAI(Creature* creature) : ScriptedAI(creature) {} - - bool CanTalk; - bool CanEmote; - uint32 SaluteTimer; - uint32 ResetTimer; - uint64 PlayerGUID; - - void Reset() - { - CanTalk = false; - CanEmote = false; - SaluteTimer = 6000; - ResetTimer = 0; - PlayerGUID = 0; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (CanEmote) - { - if (ResetTimer <= diff) - { - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - { - if (player->GetTypeId() == TYPEID_PLAYER && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(QUEST_SHATTERED_SALUTE); - } - Reset(); - } else ResetTimer -= diff; - } - - if (CanTalk && !CanEmote) - { - if (SaluteTimer <= diff) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - CanEmote = true; - ResetTimer = 60000; - } else SaluteTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* player, uint32 emote) - { - if (emote == TEXT_EMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - { - if (CanEmote) - { - player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE); - Reset(); - } - } - } - }; - -}; - -/*###### -## npc_thrall_warchief -######*/ - -enum ThrallWarchief -{ - QUEST_6566 = 6566, - - SPELL_CHAIN_LIGHTNING = 16033, - SPELL_SHOCK = 16034 -}; - -#define GOSSIP_HTW "Please share your wisdom with me, Warchief." -#define GOSSIP_STW1 "What discoveries?" -#define GOSSIP_STW2 "Usurper?" -#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?" -#define GOSSIP_STW4 "I... I did not think of it that way, Warchief." -#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance." -#define GOSSIP_STW6 "Of course, Warchief!" - -//TODO: verify abilities/timers -class npc_thrall_warchief : public CreatureScript -{ -public: - npc_thrall_warchief() : CreatureScript("npc_thrall_warchief") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(5733, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(5734, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(5735, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(5736, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(5737, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - player->SEND_GOSSIP_MENU(5738, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(QUEST_6566); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_thrall_warchiefAI (creature); - } - - struct npc_thrall_warchiefAI : public ScriptedAI - { - npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ChainLightningTimer; - uint32 ShockTimer; - - void Reset() - { - ChainLightningTimer = 2000; - ShockTimer = 8000; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ChainLightningTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - ChainLightningTimer = 9000; - } else ChainLightningTimer -= diff; - - if (ShockTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SHOCK); - ShockTimer = 15000; - } else ShockTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - void AddSC_orgrimmar() { - new npc_shenthul(); - new npc_thrall_warchief(); } diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 639de3dc3b2..1636c867b30 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -19,14 +19,14 @@ /* ScriptData SDName: Silithus SD%Complete: 100 -SDComment: Quest support: 7785, 8304, 8507. +SDComment: Quest support: 7785, 8304. SDCategory: Silithus EndScriptData */ /* ContentData npc_highlord_demitrian npcs_rutgar_and_frankal -quest_a_pawn_on_the_eternal_pawn +go_wind_stone EndContentData */ #include "ScriptMgr.h" @@ -224,930 +224,6 @@ public: }; -/*#### -# quest_a_pawn_on_the_eternal_board (Defines) -####*/ -enum EternalBoard -{ - QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, - - FACTION_HOSTILE = 14, - FACTION_FRIENDLY = 35, - - C_ANACHRONOS = 15381, - C_FANDRAL_STAGHELM = 15382, - C_ARYGOS = 15380, - C_MERITHRA = 15378, - C_CAELESTRASZ = 15379, - - ANACHRONOS_SAY_1 = -1350000, - ANACHRONOS_SAY_2 = -1350001, - ANACHRONOS_SAY_3 = -1350002, - ANACHRONOS_SAY_4 = -1350003, - ANACHRONOS_SAY_5 = -1350004, - ANACHRONOS_SAY_6 = -1350005, - ANACHRONOS_SAY_7 = -1350006, - ANACHRONOS_SAY_8 = -1350007, - ANACHRONOS_SAY_9 = -1350008, - ANACHRONOS_SAY_10 = -1350009, - ANACHRONOS_EMOTE_1 = -1350010, - ANACHRONOS_EMOTE_2 = -1350011, - ANACHRONOS_EMOTE_3 = -1350012, - - FANDRAL_SAY_1 = -1350013, - FANDRAL_SAY_2 = -1350014, - FANDRAL_SAY_3 = -1350015, - FANDRAL_SAY_4 = -1350016, - FANDRAL_SAY_5 = -1350017, - FANDRAL_SAY_6 = -1350018, - FANDRAL_EMOTE_1 = -1350019, - FANDRAL_EMOTE_2 = -1350020, - - CAELESTRASZ_SAY_1 = -1350021, - CAELESTRASZ_SAY_2 = -1350022, - CAELESTRASZ_YELL_1 = -1350023, - - ARYGOS_SAY_1 = -1350024, - ARYGOS_YELL_1 = -1350025, - ARYGOS_EMOTE_1 = -1350026, - - MERITHRA_SAY_1 = -1350027, - MERITHRA_SAY_2 = -1350028, - MERITHRA_YELL_1 = -1350029, - MERITHRA_EMOTE_1 = -1350030, - - GO_GATE_OF_AHN_QIRAJ = 176146, - GO_GLYPH_OF_AHN_QIRAJ = 176148, - GO_ROOTS_OF_AHN_QIRAJ = 176147 -}; -/*##### -# Quest: A Pawn on the Eternal Board -#####*/ - -/* ContentData -A Pawn on the Eternal Board - creatures, gameobjects and defines -mob_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle. -npc_anachronos_the_ancient : Creature that controls the event. -npc_anachronos_quest_trigger: controls the spawning of the BG War mobs. -go_crystalline_tear : GameObject that begins the event and hands out quest -TO DO: get correct spell IDs and timings for spells cast upon dragon transformations -TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work. -EndContentData */ - -#define EVENT_AREA_RADIUS 65 //65yds -#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) - -struct QuestCinematic -{ - int32 TextId; - uint32 Creature, Timer; -}; - -// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz -static QuestCinematic EventAnim[]= -{ - {ANACHRONOS_SAY_1, 0, 2000}, - {FANDRAL_SAY_1, 1, 4000}, - {MERITHRA_EMOTE_1, 3, 500}, - {MERITHRA_SAY_1, 3, 500}, - {ARYGOS_EMOTE_1, 2, 2000}, - {CAELESTRASZ_SAY_1, 4, 8000}, - {MERITHRA_SAY_2, 3, 6000}, - {0, 3, 2000}, - {MERITHRA_YELL_1, 3, 2500}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 4000}, // spell - {0, 3, 1250}, //fly - {0, 3, 250}, //remove flags - {ARYGOS_SAY_1, 2, 3000}, - {0, 3, 2000}, - {ARYGOS_YELL_1, 2, 3000}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 4000}, // spell - {0, 3, 1000}, //fly - {0, 3, 1000}, //remove flags - {CAELESTRASZ_SAY_2, 4, 5000}, - {0, 3, 3000}, - {CAELESTRASZ_YELL_1, 4, 3000}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 2500}, // spell - {ANACHRONOS_SAY_2, 0, 2000}, - {0, 3, 250}, //fly - {0, 3, 25}, //remove flags - {FANDRAL_SAY_2, 1, 3000}, - {ANACHRONOS_SAY_3, 0, 10000}, //Both run through the armies - {0, 3, 2000}, // Sands will stop - {0, 3, 8000}, // Summon Gate - {ANACHRONOS_SAY_4, 0, 4000}, - {0, 0, 2000}, //spell 1-> Arcane cosmetic (Mobs freeze) - {0, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs) - {0, 0, 7000}, //BarrieR - {0, 0, 4000}, //Glyphs - {ANACHRONOS_SAY_5, 0, 2000}, - {0, 0, 4000}, // Roots - {FANDRAL_SAY_3, 1, 3000}, //Root Text - {FANDRAL_EMOTE_1, 1, 3000}, //falls knee - {ANACHRONOS_SAY_6, 0, 3000}, - {ANACHRONOS_SAY_7, 0, 3000}, - {ANACHRONOS_SAY_8, 0, 8000}, - {ANACHRONOS_EMOTE_1, 0, 1000}, //Give Scepter - {FANDRAL_SAY_4, 1, 3000}, - {FANDRAL_SAY_5, 1, 3000}, //->Equip hammer~Scepter, throw it at door - {FANDRAL_EMOTE_2, 1, 3000}, //Throw hammer at door. - {ANACHRONOS_SAY_9, 0, 3000}, - {FANDRAL_SAY_6, 1, 3000}, //fandral goes away - {ANACHRONOS_EMOTE_2, 0, 3000}, - {ANACHRONOS_EMOTE_3, 0, 3000}, - {0, 0, 2000}, - {0, 0, 2000}, - {0, 0, 4000}, - {ANACHRONOS_SAY_10, 0, 3000}, - {0, 0, 2000}, - {0, 0, 3000}, - {0, 0, 15000}, - {0, 0, 5000}, - {0, 0, 3500}, - {0, 0, 5000}, - {0, 0, 3500}, - {0, 0, 5000}, - {0, 0, 0} -}; - -//Cordinates for Spawns -Position const SpawnLocation[] = -{ - {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8085.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1424.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1422.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - // 2 waves of warriors - {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1525.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1523.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1521.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1519.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8088.0f, 1510.0f, 2.61f, 0.0f}, //Anubisath Conqueror - {-8084.0f, 1520.0f, 2.61f, 0.0f}, //Anubisath Conqueror - {-8088.0f, 1530.0f, 2.61f, 0.0f}, //Anubisath Conqueror - - {-8080.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8085.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8085.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Wasp - - {-8082.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8079.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1531.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8079.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp - - {-8081.0f, 1514.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1526.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1512.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Tank - - {-8082.0f, 1513.0f, 2.61f, 3.141592f}, //Anubisath Conqueror - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Anubisath Conqueror - {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Anubisath Conqueror -}; - -struct WaveData -{ - uint8 SpawnCount, UsedSpawnPoint; - uint32 CreatureId, SpawnTimer, YellTimer, DespTimer; - int32 WaveTextId; -}; - -static WaveData WavesInfo[5] = -{ - {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier - { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror - {12, 38, 15414, 0, 0, 24000, 0}, // Qiraji Wasps - { 6, 50, 15422, 0, 0, 24000, 0}, // Qiraji Tanks - {15, 15, 15423, 0, 0, 24000, 0} // Kaldorei Soldier - -}; - -struct SpawnSpells -{ - uint32 Timer1, Timer2, SpellId; -}; - -static SpawnSpells SpawnCast[4] = -{ - {100000, 2000, 33652}, // Stop Time - {38500, 300000, 28528}, // Poison Cloud - {58000, 300000, 35871}, // Frost Debuff (need correct spell) - {80950, 300000, 42075}, // Fire Explosion (need correct spell however this one looks cool) -}; -/*##### -# npc_anachronos_the_ancient -######*/ -class npc_anachronos_the_ancient : public CreatureScript -{ -public: - npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_anachronos_the_ancientAI(creature); - } - - struct npc_anachronos_the_ancientAI : public ScriptedAI - { - npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 AnimationTimer; - uint8 AnimationCount; - - uint64 AnachronosQuestTriggerGUID; - uint64 MerithraGUID; - uint64 ArygosGUID; - uint64 CaelestraszGUID; - uint64 FandralGUID; - uint64 PlayerGUID; - bool eventEnd; - - void Reset() - { - AnimationTimer = 1500; - AnimationCount = 0; - AnachronosQuestTriggerGUID = 0; - MerithraGUID = 0; - ArygosGUID = 0; - CaelestraszGUID = 0; - FandralGUID = 0; - PlayerGUID = 0; - eventEnd = false; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void HandleAnimation() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player) - return; - - Unit* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me); - Unit* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f, me); - Unit* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f, me); - Unit* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f, me); - - if (!Fandral || !Arygos || !Caelestrasz || !Merithra) - return; - - Unit* mob = NULL; - AnimationTimer = EventAnim[AnimationCount].Timer; - if (eventEnd == false) - { - switch (AnimationCount) - { - case 0: - DoScriptText(ANACHRONOS_SAY_1, me, Fandral); - break; - case 1: - Fandral->SetTarget(me->GetGUID()); - DoScriptText(FANDRAL_SAY_1, Fandral, me); - break; - case 2: - Fandral->SetTarget(0); - DoScriptText(MERITHRA_EMOTE_1, Merithra); - break; - case 3: - DoScriptText(MERITHRA_SAY_1, Merithra); - break; - case 4: - DoScriptText(ARYGOS_EMOTE_1, Arygos); - break; - case 5: - Caelestrasz->SetTarget(Fandral->GetGUID()); - DoScriptText(CAELESTRASZ_SAY_1, Caelestrasz); - break; - case 6: - DoScriptText(MERITHRA_SAY_2, Merithra); - break; - case 7: - Caelestrasz->SetTarget(0); - Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - break; - case 8: - DoScriptText(MERITHRA_YELL_1, Merithra); - break; - case 9: - Merithra->CastSpell(Merithra, 25105, true); - break; - case 10: - Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Merithra->SetDisableGravity(true); - Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); - break; - case 11: - Merithra->CastSpell(Merithra, 24818, false); - break; - case 12: - Merithra->GetMotionMaster()->MoveCharge(-8100, 1530, 50, 42); - break; - case 13: - break; - case 14: - DoScriptText(ARYGOS_SAY_1, Arygos); - Merithra->SetVisible(false); - break; - case 15: - Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - Merithra->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); - break; - case 16: - DoScriptText(ARYGOS_YELL_1, Arygos); - break; - case 17: - Arygos->CastSpell(Arygos, 25107, true); - break; - case 18: - Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Arygos->SetDisableGravity(true); - Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); - break; - case 19: - Arygos->CastSpell(Arygos, 50505, false); - break; - case 20: - Arygos->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); - break; - case 21: - break; - case 22: - DoScriptText(CAELESTRASZ_SAY_2, Caelestrasz, Fandral); - break; - case 23: - Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - Arygos->SetVisible(false); - Arygos->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 10); - break; - case 24: - DoScriptText(CAELESTRASZ_YELL_1, Caelestrasz); - break; - case 25: - Caelestrasz->CastSpell(Caelestrasz, 25106, true); - break; - case 26: - Caelestrasz->HandleEmoteCommand(254); - Caelestrasz->SetDisableGravity(true); - Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); - break; - case 27: - Caelestrasz->CastSpell(Caelestrasz, 54293, false); - break; - case 28: - DoScriptText(ANACHRONOS_SAY_2, me, Fandral); - break; - case 29: - Caelestrasz->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); - DoScriptText(FANDRAL_SAY_2, Fandral, me); - break; - case 30: - break; - case 31: - DoScriptText(ANACHRONOS_SAY_3, me, Fandral); - break; - case 32: - Caelestrasz->SetVisible(false); - Caelestrasz->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); - Fandral->GetMotionMaster()->MoveCharge(-8108, 1529, 2.77f, 8); - me->GetMotionMaster()->MoveCharge(-8113, 1525, 2.77f, 8); - break;//both run to the gate - case 33: - DoScriptText(ANACHRONOS_SAY_4, me); - Caelestrasz->GetMotionMaster()->MoveCharge(-8050, 1473, 65, 15); - break; //Text: sands will stop - case 34: - DoCast(player, 23017, true);//Arcane Channeling - break; - case 35: - me->CastSpell(-8088, 1520.43f, 2.67f, 25158, true); - break; - case 36: - DoCast(player, 25159, true); - break; - case 37: - me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - break; - case 38: - DoCast(player, 25166, true); - me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - break; - case 39: - DoScriptText(ANACHRONOS_SAY_5, me, Fandral); - break; - case 40: - Fandral->CastSpell(me, 25167, true); - break; - case 41: - Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - DoScriptText(FANDRAL_SAY_3, Fandral); - break; - case 42: - me->CastStop(); - DoScriptText(FANDRAL_EMOTE_1, Fandral); - break; - case 43: - Fandral->CastStop(); - break; - case 44: - DoScriptText(ANACHRONOS_SAY_6, me); - break; - case 45: - DoScriptText(ANACHRONOS_SAY_7, me); - break; - case 46: - DoScriptText(ANACHRONOS_SAY_8, me); - me->GetMotionMaster()->MoveCharge(-8110, 1527, 2.77f, 4); - break; - case 47: - DoScriptText(ANACHRONOS_EMOTE_1, me); - break; - case 48: - DoScriptText(FANDRAL_SAY_4, Fandral, me); - break; - case 49: - DoScriptText(FANDRAL_SAY_5, Fandral, me); - break; - case 50: - DoScriptText(FANDRAL_EMOTE_2, Fandral); - Fandral->CastSpell(-8127, 1525, 17.5f, 33806, true); - break; - case 51: - { - uint32 entries[4] = { 15423, 15424, 15414, 15422 }; - for (uint8 i = 0; i < 4; ++i) - { - mob = player->FindNearestCreature(entries[i], 50, me); - while (mob) - { - mob->RemoveFromWorld(); - mob = player->FindNearestCreature(15423, 50, me); - } - } - break; - } - case 52: - Fandral->GetMotionMaster()->MoveCharge(-8028.75f, 1538.795f, 2.61f, 4); - DoScriptText(ANACHRONOS_SAY_9, me, Fandral); - break; - case 53: - DoScriptText(FANDRAL_SAY_6, Fandral); - break; - case 54: - DoScriptText(ANACHRONOS_EMOTE_2, me); - break; - case 55: - Fandral->SetVisible(false); - break; - case 56: - DoScriptText(ANACHRONOS_EMOTE_3, me); - me->GetMotionMaster()->MoveCharge(-8116, 1522, 3.65f, 4); - break; - case 57: - me->GetMotionMaster()->MoveCharge(-8116.7f, 1527, 3.7f, 4); - break; - case 58: - me->GetMotionMaster()->MoveCharge(-8112.67f, 1529.9f, 2.86f, 4); - break; - case 59: - me->GetMotionMaster()->MoveCharge(-8117.99f, 1532.24f, 3.94f, 4); - break; - case 60: - if (player) - DoScriptText(ANACHRONOS_SAY_10, me, player); - me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4); - break; - case 61: - me->GetMotionMaster()->MoveCharge(-8057.1f, 1470.32f, 2.61f, 6); - if (player->IsInRange(me, 0, 15)) - player->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, me); - break; - case 62: - me->SetDisplayId(15500); - break; - case 63: - me->HandleEmoteCommand(254); - me->SetDisableGravity(true); - break; - case 64: - me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); - break; - case 65: - me->SetVisible(false); - if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID))) - { - DoScriptText(ARYGOS_YELL_1, me); - AnachronosQuestTrigger->AI()->EnterEvadeMode(); - eventEnd=true; - } - break; - } - } - ++AnimationCount; - } - void UpdateAI(const uint32 diff) - { - if (AnimationTimer) - { - if (AnimationTimer <= diff) - HandleAnimation(); - else AnimationTimer -= diff; - } - if (AnimationCount < 65) - me->CombatStop(); - if (AnimationCount == 65 || eventEnd) - me->AI()->EnterEvadeMode(); - } - }; - -}; - -/*###### -# mob_qiraj_war_spawn -######*/ - -class mob_qiraj_war_spawn : public CreatureScript -{ -public: - mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_qiraj_war_spawnAI(creature); - } - - struct mob_qiraj_war_spawnAI : public ScriptedAI - { - mob_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 MobGUID; - uint64 PlayerGUID; - uint32 SpellTimer1, SpellTimer2, SpellTimer3, SpellTimer4; - bool Timers; - bool hasTarget; - - void Reset() - { - MobGUID = 0; - PlayerGUID = 0; - Timers = false; - hasTarget = false; - } - - void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*slayer*/); - - void UpdateAI(const uint32 diff) - { - Unit* target = NULL; - //Player* player = me->GetPlayer(PlayerGUID); - - if (!Timers) - { - if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers - { - SpellTimer1 = SpawnCast[1].Timer1; - SpellTimer2 = SpawnCast[2].Timer1; - SpellTimer3 = SpawnCast[3].Timer1; - } - if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - SpellTimer4 = SpawnCast[0].Timer1; - Timers = true; - } - if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414) - { - if (SpellTimer1 <= diff) - { - DoCast(me, SpawnCast[1].SpellId); - DoCast(me, 24319); - SpellTimer1 = SpawnCast[1].Timer2; - } else SpellTimer1 -= diff; - if (SpellTimer2 <= diff) - { - DoCast(me, SpawnCast[2].SpellId); - SpellTimer2 = SpawnCast[2].Timer2; - } else SpellTimer2 -= diff; - if (SpellTimer3 <= diff) - { - DoCast(me, SpawnCast[3].SpellId); - SpellTimer3 = SpawnCast[3].Timer2; - } else SpellTimer3 -= diff; - } - if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - { - if (SpellTimer4 <= diff) - { - me->RemoveAllAttackers(); - me->AttackStop(); - DoCast(me, 15533); - SpellTimer4 = SpawnCast[0].Timer2; - } else SpellTimer4 -= diff; - } - if (!hasTarget) - { - if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - target = me->FindNearestCreature(15423, 20, true); - if (me->GetEntry() == 15423) - { - uint8 tar = urand(0, 2); - - if (tar == 0) - target = me->FindNearestCreature(15422, 20, true); - else if (tar == 1) - target = me->FindNearestCreature(15424, 20, true); - else if (tar == 2) - target = me->FindNearestCreature(15414, 20, true); - } - hasTarget = true; - if (target) - me->AI()->AttackStart(target); - } - if (!(me->FindNearestCreature(15379, 60))) - DoCast(me, 33652); - - if (!UpdateVictim()) - { - hasTarget = false; - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*##### -# npc_anachronos_quest_trigger -#####*/ - -class npc_anachronos_quest_trigger : public CreatureScript -{ -public: - npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_anachronos_quest_triggerAI(creature); - } - - struct npc_anachronos_quest_triggerAI : public ScriptedAI - { - npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 PlayerGUID; - - uint32 WaveTimer; - uint32 AnnounceTimer; - - int8 LiveCount; - uint8 WaveCount; - - bool EventStarted; - bool Announced; - bool Failed; - - void Reset() - { - PlayerGUID = 0; - - WaveTimer = 2000; - AnnounceTimer = 1000; - LiveCount = 0; - WaveCount = 0; - - EventStarted = false; - Announced = false; - Failed = false; - - me->SetVisible(false); - } - - void SummonNextWave() - { - uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; - uint8 count = locIndex + WavesInfo[WaveCount].SpawnCount; - - for (uint8 i = locIndex; i <= count; ++i) - { - uint32 desptimer = WavesInfo[WaveCount].DespTimer; - - if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) - { - if (spawn->GetEntry() == 15423) - spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); - if (i >= 30) WaveCount = 1; - if (i >= 33) WaveCount = 2; - if (i >= 45) WaveCount = 3; - if (i >= 51) WaveCount = 4; - - if (WaveCount < 5) //1-4 Wave - { - if (mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI())) - { - spawnAI->MobGUID = me->GetGUID(); - spawnAI->PlayerGUID = PlayerGUID; - } - } - } - } - - WaveTimer = WavesInfo[WaveCount].SpawnTimer; - AnnounceTimer = WavesInfo[WaveCount].YellTimer; - } - - void CheckEventFail() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - - if (!player) - return; - - if (Group* EventGroup = player->GetGroup()) - { - Player* groupMember; - - uint8 GroupMemberCount = 0; - uint8 DeadMemberCount = 0; - uint8 FailedMemberCount = 0; - - Group::MemberSlotList const members = EventGroup->GetMemberSlots(); - - for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr) - { - groupMember = (Unit::GetPlayer(*me, itr->guid)); - if (!groupMember) - continue; - if (!groupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && groupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) - { - groupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); - ++FailedMemberCount; - } - ++GroupMemberCount; - - if (groupMember->isDead()) - ++DeadMemberCount; - } - - if (GroupMemberCount == FailedMemberCount || !player->IsWithinDistInMap(me, EVENT_AREA_RADIUS)) - Failed = true; //only so event can restart - } - } - - void LiveCounter() - { - --LiveCount; - if (!LiveCount) - Announced = false; - } - - void UpdateAI(const uint32 diff) - { - if (!PlayerGUID || !EventStarted) - return; - - if (WaveCount < 4) - { - if (!Announced && AnnounceTimer <= diff) - { - DoScriptText(WavesInfo[WaveCount].WaveTextId, me); - Announced = true; - } else AnnounceTimer -= diff; - - if (WaveTimer <= diff) - SummonNextWave(); - else WaveTimer -= diff; - } - CheckEventFail(); - if (WaveCount == 4 || Failed) - EnterEvadeMode(); - }; - }; - -}; - -void mob_qiraj_war_spawn::mob_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/) -{ - me->RemoveCorpse(); - - if (!MobGUID) - return; - - if (Creature* mob = Unit::GetCreature(*me, MobGUID)) - if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI())) - triggerAI->LiveCounter(); - -}; - -/*##### -# go_crystalline_tear -######*/ - -class go_crystalline_tear : public GameObjectScript -{ -public: - go_crystalline_tear() : GameObjectScript("go_crystalline_tear") { } - - bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) - { - if (Creature* trigger = go->FindNearestCreature(15454, 100, player)) - { - Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - - if (Merithra) - { - Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420); - Merithra->setFaction(35); - } - - if (Caelestrasz) - { - Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419); - Caelestrasz->setFaction(35); - } - - if (Arygos) - { - Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418); - Arygos->setFaction(35); - } - - if (Anachronos) - { - if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())) - anachronosAI->PlayerGUID = player->GetGUID(); - - if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI())) - { - triggerAI->Failed = false; - triggerAI->PlayerGUID = player->GetGUID(); - triggerAI->EventStarted = true; - triggerAI->Announced = true; - } - } - } - } - return true; - } - -}; /*### ## go_wind_stone @@ -1506,10 +582,6 @@ class go_wind_stone : public GameObjectScript void AddSC_silithus() { - new go_crystalline_tear(); - new npc_anachronos_quest_trigger(); - new npc_anachronos_the_ancient(); - new mob_qiraj_war_spawn(); new npc_highlord_demitrian(); new npcs_rutgar_and_frankal(); new go_wind_stone(); diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index d38395c7b37..2ac9903aa18 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -18,14 +18,12 @@ /* ScriptData SDName: Stonetalon_Mountains -SD%Complete: 95 -SDComment: Quest support: 6627, 6523 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Stonetalon Mountains EndScriptData */ /* ContentData -npc_braug_dimspirit -npc_kaya_flathoof EndContentData */ #include "ScriptMgr.h" @@ -33,146 +31,6 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*###### -## npc_braug_dimspirit -######*/ - -#define GOSSIP_HBD1 "Ysera" -#define GOSSIP_HBD2 "Neltharion" -#define GOSSIP_HBD3 "Nozdormu" -#define GOSSIP_HBD4 "Alexstrasza" -#define GOSSIP_HBD5 "Malygos" - -class npc_braug_dimspirit : public CreatureScript -{ -public: - npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 6766, false); - - } - if (action == GOSSIP_ACTION_INFO_DEF+2) - { - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(6627); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(5820, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(5819, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_kaya_flathoof -######*/ - -enum Kaya -{ - FACTION_ESCORTEE_H = 775, - - NPC_GRIMTOTEM_RUFFIAN = 11910, - NPC_GRIMTOTEM_BRUTE = 11912, - NPC_GRIMTOTEM_SORCERER = 11913, - - SAY_START = -1000357, - SAY_AMBUSH = -1000358, - SAY_END = -1000359, - - QUEST_PROTECT_KAYA = 6523 -}; - -class npc_kaya_flathoof : public CreatureScript -{ -public: - npc_kaya_flathoof() : CreatureScript("npc_kaya_flathoof") { } - - struct npc_kaya_flathoofAI : public npc_escortAI - { - npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 16: - DoScriptText(SAY_AMBUSH, me); - me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 18: - me->SetInFront(player); - DoScriptText(SAY_END, me, player); - player->GroupEventHappens(QUEST_PROTECT_KAYA, me); - break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void Reset(){} - }; - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_PROTECT_KAYA) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - - DoScriptText(SAY_START, creature); - creature->setFaction(113); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kaya_flathoofAI(creature); - } - -}; - -/*###### -## AddSC -######*/ - void AddSC_stonetalon_mountains() { - new npc_braug_dimspirit(); - new npc_kaya_flathoof(); } diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index 9b742b495bb..45fbb15e582 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -19,18 +19,14 @@ /* ScriptData SDName: Tanaris SD%Complete: 80 -SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor +SDComment: Quest support: 648, 10277, 10279(Special flight path). SDCategory: Tanaris EndScriptData */ /* ContentData -mob_aquementas npc_custodian_of_time -npc_marin_noggenfogger npc_steward_of_time -npc_stone_watcher_of_norgannon npc_OOX17 -npc_tooga EndContentData */ #include "ScriptMgr.h" @@ -40,111 +36,6 @@ EndContentData */ #include "ScriptedFollowerAI.h" /*###### -## mob_aquementas -######*/ - -enum Aquementas -{ - AGGRO_YELL_AQUE = -1000350, - - SPELL_AQUA_JET = 13586, - SPELL_FROST_SHOCK = 15089 -}; - -class mob_aquementas : public CreatureScript -{ -public: - mob_aquementas() : CreatureScript("mob_aquementas") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_aquementasAI (creature); - } - - struct mob_aquementasAI : public ScriptedAI - { - mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 SendItemTimer; - uint32 SwitchFactionTimer; - bool isFriendly; - - uint32 FrostShockTimer; - uint32 AquaJetTimer; - - void Reset() - { - SendItemTimer = 0; - SwitchFactionTimer = 10000; - me->setFaction(35); - isFriendly = true; - - AquaJetTimer = 5000; - FrostShockTimer = 1000; - } - - void SendItem(Unit* receiver) - { - if (CAST_PLR(receiver)->HasItemCount(11169, 1, false) && - CAST_PLR(receiver)->HasItemCount(11172, 11, false) && - CAST_PLR(receiver)->HasItemCount(11173, 1, false) && - !CAST_PLR(receiver)->HasItemCount(11522, 1, true)) - { - ItemPosCountVec dest; - uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL); - if (msg == EQUIP_ERR_OK) - CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true); - } - } - - void EnterCombat(Unit* who) - { - DoScriptText(AGGRO_YELL_AQUE, me, who); - } - - void UpdateAI(const uint32 diff) - { - if (isFriendly) - { - if (SwitchFactionTimer <= diff) - { - me->setFaction(91); - isFriendly = false; - } else SwitchFactionTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!isFriendly) - { - if (SendItemTimer <= diff) - { - if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) - SendItem(me->getVictim()); - SendItemTimer = 5000; - } else SendItemTimer -= diff; - } - - if (FrostShockTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FROST_SHOCK); - FrostShockTimer = 15000; - } else FrostShockTimer -= diff; - - if (AquaJetTimer <= diff) - { - DoCast(me, SPELL_AQUA_JET); - AquaJetTimer = 15000; - } else AquaJetTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### ## npc_custodian_of_time ######*/ @@ -277,39 +168,6 @@ public: }; /*###### -## npc_marin_noggenfogger -######*/ - -class npc_marin_noggenfogger : public CreatureScript -{ -public: - npc_marin_noggenfogger() : CreatureScript("npc_marin_noggenfogger") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestRewardStatus(2662)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - -/*###### ## npc_steward_of_time ######*/ @@ -356,70 +214,6 @@ public: }; /*###### -## npc_stone_watcher_of_norgannon -######*/ - -#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?" -#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!" -#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?" -#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum." - -class npc_stone_watcher_of_norgannon : public CreatureScript -{ -public: - npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(1675, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(1676, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(1677, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(1678, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(1679, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2954); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(1674, creature->GetGUID()); - - return true; - } - -}; - -/*###### ## npc_OOX17 ######*/ @@ -511,176 +305,9 @@ public: }; }; -/*#### -# npc_tooga -####*/ - -enum Tooga -{ - SAY_TOOG_THIRST = -1000391, - SAY_TOOG_WORRIED = -1000392, - SAY_TOOG_POST_1 = -1000393, - SAY_TORT_POST_2 = -1000394, - SAY_TOOG_POST_3 = -1000395, - SAY_TORT_POST_4 = -1000396, - SAY_TOOG_POST_5 = -1000397, - SAY_TORT_POST_6 = -1000398, - - QUEST_TOOGA = 1560, - NPC_TORTA = 6015, - - POINT_ID_TO_WATER = 1, - FACTION_TOOG_ESCORTEE = 113 -}; - -Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f}; - -class npc_tooga : public CreatureScript -{ -public: - npc_tooga() : CreatureScript("npc_tooga") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_TOOGA) - { - if (npc_toogaAI* pToogaAI = CAST_AI(npc_tooga::npc_toogaAI, creature->AI())) - pToogaAI->StartFollow(player, FACTION_TOOG_ESCORTEE, quest); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_toogaAI(creature); - } - - struct npc_toogaAI : public FollowerAI - { - npc_toogaAI(Creature* creature) : FollowerAI(creature) { } - - uint32 CheckSpeechTimer; - uint32 PostEventTimer; - uint32 PhasePostEvent; - - uint64 TortaGUID; - - void Reset() - { - CheckSpeechTimer = 2500; - PostEventTimer = 1000; - PhasePostEvent = 0; - - TortaGUID = 0; - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - Player* player = GetLeaderForFollower(); - if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_TOOGA, me); - - TortaGUID = who->GetGUID(); - SetFollowComplete(true); - } - } - } - - void MovementInform(uint32 MotionType, uint32 PointId) - { - FollowerAI::MovementInform(MotionType, PointId); - - if (MotionType != POINT_MOTION_TYPE) - return; - - if (PointId == POINT_ID_TO_WATER) - SetFollowComplete(); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - //we are doing the post-event, or... - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - if (PostEventTimer <= Diff) - { - PostEventTimer = 5000; - - Unit* pTorta = Unit::GetUnit(*me, TortaGUID); - if (!pTorta || !pTorta->isAlive()) - { - //something happened, so just complete - SetFollowComplete(); - return; - } - - switch (PhasePostEvent) - { - case 1: - DoScriptText(SAY_TOOG_POST_1, me); - break; - case 2: - DoScriptText(SAY_TORT_POST_2, pTorta); - break; - case 3: - DoScriptText(SAY_TOOG_POST_3, me); - break; - case 4: - DoScriptText(SAY_TORT_POST_4, pTorta); - break; - case 5: - DoScriptText(SAY_TOOG_POST_5, me); - break; - case 6: - DoScriptText(SAY_TORT_POST_6, pTorta); - me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc); - break; - } - - ++PhasePostEvent; - } - else - PostEventTimer -= Diff; - } - //...we are doing regular speech check - else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) - { - if (CheckSpeechTimer <= Diff) - { - CheckSpeechTimer = 5000; - - if (urand(0, 9) > 8) - DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me); - } - else - CheckSpeechTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - void AddSC_tanaris() { - new mob_aquementas(); new npc_custodian_of_time(); - new npc_marin_noggenfogger(); new npc_steward_of_time(); - new npc_stone_watcher_of_norgannon(); new npc_OOX17(); - new npc_tooga(); } diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index f4983558b67..5b13fe9591f 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -19,16 +19,11 @@ /* ScriptData SDName: The_Barrens SD%Complete: 90 -SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981, +SDComment: Quest support: 863 SDCategory: Barrens EndScriptData */ /* ContentData -npc_beaten_corpse -npc_gilthares -npc_sputtervalve -npc_taskmaster_fizzule -npc_twiggy_flathead npc_wizzlecrank_shredder EndContentData */ @@ -37,491 +32,6 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*###### -## npc_beaten_corpse -######*/ - -#define GOSSIP_CORPSE "Examine corpse in detail..." - -enum BeatenCorpse -{ - QUEST_LOST_IN_BATTLE = 4921 -}; - -class npc_beaten_corpse : public CreatureScript -{ -public: - npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF +1) - { - player->SEND_GOSSIP_MENU(3558, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(3557, creature->GetGUID()); - return true; - } - -}; - -/*###### -# npc_gilthares -######*/ - -enum Gilthares -{ - SAY_GIL_START = -1000370, - SAY_GIL_AT_LAST = -1000371, - SAY_GIL_PROCEED = -1000372, - SAY_GIL_FREEBOOTERS = -1000373, - SAY_GIL_AGGRO_1 = -1000374, - SAY_GIL_AGGRO_2 = -1000375, - SAY_GIL_AGGRO_3 = -1000376, - SAY_GIL_AGGRO_4 = -1000377, - SAY_GIL_ALMOST = -1000378, - SAY_GIL_SWEET = -1000379, - SAY_GIL_FREED = -1000380, - - QUEST_FREE_FROM_HOLD = 898, - AREA_MERCHANT_COAST = 391, - FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest -}; - -class npc_gilthares : public CreatureScript -{ -public: - npc_gilthares() : CreatureScript("npc_gilthares") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) - { - creature->setFaction(FACTION_ESCORTEE); - creature->SetStandState(UNIT_STAND_STATE_STAND); - - DoScriptText(SAY_GIL_START, creature, player); - - if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_giltharesAI(creature); - } - - struct npc_giltharesAI : public npc_escortAI - { - npc_giltharesAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 16: - DoScriptText(SAY_GIL_AT_LAST, me, player); - break; - case 17: - DoScriptText(SAY_GIL_PROCEED, me, player); - break; - case 18: - DoScriptText(SAY_GIL_FREEBOOTERS, me, player); - break; - case 37: - DoScriptText(SAY_GIL_ALMOST, me, player); - break; - case 47: - DoScriptText(SAY_GIL_SWEET, me, player); - break; - case 53: - DoScriptText(SAY_GIL_FREED, me, player); - player->GroupEventHappens(QUEST_FREE_FROM_HOLD, me); - break; - } - } - - void EnterCombat(Unit* who) - { - //not always use - if (rand()%4) - return; - - //only aggro text if not player and only in this area - if (who->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST) - { - //appears to be pretty much random (possible only if escorter not in combat with who yet?) - DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), me, who); - } - } - }; - -}; - -/*###### -## npc_sputtervalve -######*/ - -#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?" - -class npc_sputtervalve : public CreatureScript -{ -public: - npc_sputtervalve() : CreatureScript("npc_sputtervalve") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->SEND_GOSSIP_MENU(2013, creature->GetGUID()); - player->AreaExploredOrEventHappens(6981); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - -}; - -/*###### -## npc_taskmaster_fizzule -######*/ - -enum TaskmasterFizzule -{ - FACTION_FRIENDLY_F = 35, - SPELL_FLARE = 10113, - SPELL_FOLLY = 10137, -}; - -class npc_taskmaster_fizzule : public CreatureScript -{ -public: - npc_taskmaster_fizzule() : CreatureScript("npc_taskmaster_fizzule") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_taskmaster_fizzuleAI(creature); - } - - struct npc_taskmaster_fizzuleAI : public ScriptedAI - { - npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) - { - factionNorm = creature->getFaction(); - } - - uint32 factionNorm; - bool IsFriend; - uint32 ResetTimer; - uint8 FlareCount; - - void Reset() - { - IsFriend = false; - ResetTimer = 120000; - FlareCount = 0; - me->setFaction(factionNorm); - } - - void DoFriend() - { - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - - me->StopMoving(); - me->GetMotionMaster()->MoveIdle(); - - me->setFaction(FACTION_FRIENDLY_F); - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - } - - void SpellHit(Unit* /*caster*/, const SpellInfo* spell) - { - if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) - { - ++FlareCount; - - if (FlareCount >= 2) - IsFriend = true; - } - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (IsFriend) - { - if (ResetTimer <= diff) - { - EnterEvadeMode(); - return; - } else ResetTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* /*player*/, uint32 emote) - { - if (emote == TEXT_EMOTE_SALUTE) - { - if (FlareCount >= 2) - { - if (me->getFaction() == FACTION_FRIENDLY_F) - return; - - DoFriend(); - } - } - } - }; - -}; - -/*##### -## npc_twiggy_flathead -#####*/ - -enum TwiggyFlathead -{ - NPC_BIG_WILL = 6238, - NPC_AFFRAY_CHALLENGER = 6240, - - SAY_BIG_WILL_READY = -1000123, - SAY_TWIGGY_FLATHEAD_BEGIN = -1000124, - SAY_TWIGGY_FLATHEAD_FRAY = -1000125, - SAY_TWIGGY_FLATHEAD_DOWN = -1000126, - SAY_TWIGGY_FLATHEAD_OVER = -1000127, -}; - -Position const AffrayChallengerLoc[6] = -{ - {-1683.0f, -4326.0f, 2.79f, 0.0f}, - {-1682.0f, -4329.0f, 2.79f, 0.0f}, - {-1683.0f, -4330.0f, 2.79f, 0.0f}, - {-1680.0f, -4334.0f, 2.79f, 1.49f}, - {-1674.0f, -4326.0f, 2.79f, 3.49f}, - {-1677.0f, -4334.0f, 2.79f, 1.66f} -}; - -class npc_twiggy_flathead : public CreatureScript -{ -public: - npc_twiggy_flathead() : CreatureScript("npc_twiggy_flathead") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_twiggy_flatheadAI (creature); - } - - struct npc_twiggy_flatheadAI : public ScriptedAI - { - npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) {} - - bool EventInProgress; - bool EventGrate; - bool EventBigWill; - bool ChallengerDown[6]; - uint8 Wave; - uint32 WaveTimer; - uint32 ChallengerChecker; - uint64 PlayerGUID; - uint64 AffrayChallenger[6]; - uint64 BigWill; - - void Reset() - { - EventInProgress = false; - EventGrate = false; - EventBigWill = false; - WaveTimer = 600000; - ChallengerChecker = 0; - Wave = 0; - PlayerGUID = 0; - - for (uint8 i = 0; i < 6; ++i) - { - AffrayChallenger[i] = 0; - ChallengerDown[i] = false; - } - BigWill = 0; - } - - void EnterCombat(Unit* /*who*/) { } - - void MoveInLineOfSight(Unit* who) - { - if (!who || (!who->isAlive())) - return; - - if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) - { - PlayerGUID = who->GetGUID(); - EventInProgress = true; - } - } - - void KilledUnit(Unit* /*victim*/) { } - - void UpdateAI(const uint32 diff) - { - if (EventInProgress) { - Player* pWarrior = NULL; - - if (PlayerGUID) - pWarrior = Unit::GetPlayer(*me, PlayerGUID); - - if (!pWarrior) - return; - - if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { - DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); - pWarrior->FailQuest(1719); - - for (uint8 i = 0; i < 6; ++i) // unsummon challengers - { - if (AffrayChallenger[i]) - { - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if (creature && creature->isAlive()) - creature->DisappearAndDie(); - } - } - - if (BigWill) // unsummon bigWill - { - Creature* creature = Unit::GetCreature((*me), BigWill); - if (creature && creature->isAlive()) - creature->DisappearAndDie(); - } - Reset(); - } - - if (!EventGrate && EventInProgress) - { - float x, y, z; - pWarrior->GetPosition(x, y, z); - - if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { - pWarrior->AreaExploredOrEventHappens(1719); - DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me, pWarrior); - - for (uint8 i = 0; i < 6; ++i) - { - Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - if (!creature) - continue; - creature->setFaction(35); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - AffrayChallenger[i] = creature->GetGUID(); - } - WaveTimer = 5000; - ChallengerChecker = 1000; - EventGrate = true; - } - } - else if (EventInProgress) - { - if (ChallengerChecker <= diff) - { - for (uint8 i = 0; i < 6; ++i) - { - if (AffrayChallenger[i]) - { - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if ((!creature || (!creature->isAlive())) && !ChallengerDown[i]) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); - ChallengerDown[i] = true; - } - } - } - ChallengerChecker = 1000; - } else ChallengerChecker -= diff; - - if (WaveTimer <= diff) - { - if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, me); - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[Wave]); - if (creature && (creature->isAlive())) - { - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - creature->setFaction(14); - creature->AI()->AttackStart(pWarrior); - ++Wave; - WaveTimer = 20000; - } - } - else if (Wave >= 6 && !EventBigWill) { - if (Creature* creature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12f, 6.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000)) - { - BigWill = creature->GetGUID(); - //creature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32f); - //creature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78f); - creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f); - creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED); - EventBigWill = true; - WaveTimer = 1000; - } - } - else if (Wave >= 6 && EventBigWill && BigWill) - { - Creature* creature = Unit::GetCreature((*me), BigWill); - if (!creature || !creature->isAlive()) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me); - Reset(); - } - } - } else WaveTimer -= diff; - } - } - } - }; - -}; - /*##### ## npc_wizzlecrank_shredder #####*/ @@ -687,10 +197,5 @@ public: void AddSC_the_barrens() { - new npc_beaten_corpse(); - new npc_gilthares(); - new npc_sputtervalve(); - new npc_taskmaster_fizzule(); - new npc_twiggy_flathead(); new npc_wizzlecrank_shredder(); } diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index b9ae356ddf1..2abef548a94 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -18,18 +18,12 @@ /* ScriptData SDName: Thousand Needles -SD%Complete: 100 -SDComment: Support for Quest: 1950, 4770, 4904, 4966, 5151. +SD%Complete: 0 +SDComment: Support for Quest: SDCategory: Thousand Needles EndScriptData */ /* ContentData -npc_kanati -npc_lakota_windsong -npc_swiftmountain -npc_plucky -npc_enraged_panther -go_panther_cage EndContentData */ #include "ScriptMgr.h" @@ -37,425 +31,7 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*##### -# npc_kanati -######*/ - -enum Kanati -{ - SAY_KAN_START = -1000410, - - QUEST_PROTECT_KANATI = 4966, - NPC_GALAK_ASS = 10720 -}; - -Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f}; - -class npc_kanati : public CreatureScript -{ -public: - npc_kanati() : CreatureScript("npc_kanati") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_PROTECT_KANATI) - if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest, true); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kanatiAI(creature); - } - - struct npc_kanatiAI : public npc_escortAI - { - npc_kanatiAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 0: - DoScriptText(SAY_KAN_START, me); - DoSpawnGalak(); - break; - case 1: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_PROTECT_KANATI, me); - break; - } - } - - void DoSpawnGalak() - { - for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - }; - -}; - -/*###### -# npc_lakota_windsong -######*/ - -enum Lakota -{ - SAY_LAKO_START = -1000365, - SAY_LAKO_LOOK_OUT = -1000366, - SAY_LAKO_HERE_COME = -1000367, - SAY_LAKO_MORE = -1000368, - SAY_LAKO_END = -1000369, - - QUEST_FREE_AT_LAST = 4904, - NPC_GRIM_BANDIT = 10758, - FACTION_ESCORTEE_LAKO = 232, //guessed - - ID_AMBUSH_1 = 0, - ID_AMBUSH_2 = 2, - ID_AMBUSH_3 = 4 -}; - -Position const BanditLoc[6] = -{ - {-4905.479492f, -2062.732666f, 84.352f, 0.0f}, - {-4915.201172f, -2073.528320f, 84.733f, 0.0f}, - {-4878.883301f, -1986.947876f, 91.966f, 0.0f}, - {-4877.503906f, -1966.113403f, 91.859f, 0.0f}, - {-4767.985352f, -1873.169189f, 90.192f, 0.0f}, - {-4788.861328f, -1888.007813f, 89.888f, 0.0f} -}; - -class npc_lakota_windsong : public CreatureScript -{ -public: - npc_lakota_windsong() : CreatureScript("npc_lakota_windsong") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_FREE_AT_LAST) - { - DoScriptText(SAY_LAKO_START, creature, player); - creature->setFaction(FACTION_ESCORTEE_LAKO); - - if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lakota_windsongAI(creature); - } - - struct npc_lakota_windsongAI : public npc_escortAI - { - npc_lakota_windsongAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 8: - DoScriptText(SAY_LAKO_LOOK_OUT, me); - DoSpawnBandits(ID_AMBUSH_1); - break; - case 14: - DoScriptText(SAY_LAKO_HERE_COME, me); - DoSpawnBandits(ID_AMBUSH_2); - break; - case 21: - DoScriptText(SAY_LAKO_MORE, me); - DoSpawnBandits(ID_AMBUSH_3); - break; - case 45: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_FREE_AT_LAST, me); - break; - } - } - - void DoSpawnBandits(int AmbushId) - { - for (int i = 0; i < 2; ++i) - me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } - }; - -}; - -/*###### -# npc_paoka_swiftmountain -######*/ - -enum Packa -{ - SAY_START = -1000362, - SAY_WYVERN = -1000363, - SAY_COMPLETE = -1000364, - - QUEST_HOMEWARD = 4770, - NPC_WYVERN = 4107, - FACTION_ESCORTEE = 232 //guessed -}; - -Position const WyvernLoc[3] = -{ - {-4990.606f, -906.057f, -5.343f, 0.0f}, - {-4970.241f, -927.378f, -4.951f, 0.0f}, - {-4985.364f, -952.528f, -5.199f, 0.0f} -}; - -class npc_paoka_swiftmountain : public CreatureScript -{ -public: - npc_paoka_swiftmountain() : CreatureScript("npc_paoka_swiftmountain") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_HOMEWARD) - { - DoScriptText(SAY_START, creature, player); - creature->setFaction(FACTION_ESCORTEE); - - if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_paoka_swiftmountainAI(creature); - } - - struct npc_paoka_swiftmountainAI : public npc_escortAI - { - npc_paoka_swiftmountainAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 15: - DoScriptText(SAY_WYVERN, me); - DoSpawnWyvern(); - break; - case 26: - DoScriptText(SAY_COMPLETE, me); - break; - case 27: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_HOMEWARD, me); - break; - } - } - - void DoSpawnWyvern() - { - for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } - }; -}; - -/*##### -# npc_plucky -######*/ - -#define GOSSIP_P "Please tell me the Phrase.." - -enum Plucky -{ - FACTION_FRIENDLY = 35, - QUEST_SCOOP = 1950, - SPELL_PLUCKY_HUMAN = 9192, - SPELL_PLUCKY_CHICKEN = 9220 -}; - -class npc_plucky : public CreatureScript -{ -public: - npc_plucky() : CreatureScript("npc_plucky") { } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->CLOSE_GOSSIP_MENU(); - player->CompleteQuest(QUEST_SCOOP); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(738, creature->GetGUID()); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_pluckyAI(creature); - } - - struct npc_pluckyAI : public ScriptedAI - { - npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } - - uint32 NormFaction; - uint32 ResetTimer; - - void Reset() - { - ResetTimer = 120000; - - if (me->getFaction() != NormFaction) - me->setFaction(NormFaction); - - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - DoCast(me, SPELL_PLUCKY_CHICKEN, false); - } - - void ReceiveEmote(Player* player, uint32 TextEmote) - { - if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - { - if (TextEmote == TEXT_EMOTE_BECKON) - { - me->setFaction(FACTION_FRIENDLY); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoCast(me, SPELL_PLUCKY_HUMAN, false); - } - } - - if (TextEmote == TEXT_EMOTE_CHICKEN) - { - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - return; - else - { - me->setFaction(FACTION_FRIENDLY); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoCast(me, SPELL_PLUCKY_HUMAN, false); - me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - } - } - } - - void UpdateAI(const uint32 Diff) - { - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - { - if (ResetTimer <= Diff) - { - if (!me->getVictim()) - EnterEvadeMode(); - else - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - return; - } - else - ResetTimer -= Diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -enum PantherCage -{ - ENRAGED_PANTHER = 10992 -}; - -class go_panther_cage : public GameObjectScript -{ -public: - go_panther_cage() : GameObjectScript("go_panther_cage") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE) - { - if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true)) - { - panther->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - panther->SetReactState(REACT_AGGRESSIVE); - panther->AI()->AttackStart(player); - } - } - - return true; - } -}; - -class npc_enraged_panther : public CreatureScript -{ -public: - npc_enraged_panther() : CreatureScript("npc_enraged_panther") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_enraged_pantherAI(creature); - } - - struct npc_enraged_pantherAI : public ScriptedAI - { - npc_enraged_pantherAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; void AddSC_thousand_needles() { - new npc_kanati(); - new npc_lakota_windsong(); - new npc_paoka_swiftmountain(); - new npc_plucky(); - new npc_enraged_panther(); - new go_panther_cage(); } diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index b8b05b9692f..4feca5929b5 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -47,30 +47,6 @@ class npc_cairne_bloodhoof : public CreatureScript public: npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_SENDER_INFO) - { - player->CastSpell(player, 23123, false); - player->SEND_GOSSIP_MENU(7014, creature->GetGUID()); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(7013, creature->GetGUID()); - - return true; - } - CreatureAI* GetAI(Creature* creature) const { return new npc_cairne_bloodhoofAI (creature); diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 786d2fc0cd3..d8d6acf3605 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -18,14 +18,12 @@ /* ScriptData SDName: Ungoro Crater -SD%Complete: 100 -SDComment: Support for Quest: 4245, 4491 +SD%Complete: 0 +SDComment: Support for Quest: SDCategory: Ungoro Crater EndScriptData */ /* ContentData -npc_a-me -npc_ringo EndContentData */ #include "ScriptMgr.h" @@ -33,321 +31,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" -enum AmeData -{ - SAY_READY = -1000517, - SAY_AGGRO1 = -1000518, - SAY_SEARCH = -1000519, - SAY_AGGRO2 = -1000520, - SAY_AGGRO3 = -1000521, - SAY_FINISH = -1000522, - - SPELL_DEMORALIZINGSHOUT = 13730, - - QUEST_CHASING_AME = 4245, - ENTRY_TARLORD = 6519, - ENTRY_TARLORD1 = 6519, - ENTRY_STOMPER = 6513, -}; - -class npc_ame : public CreatureScript -{ -public: - npc_ame() : CreatureScript("npc_ame") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_CHASING_AME) - { - CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); - DoScriptText(SAY_READY, creature, player); - creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - // Change faction so mobs attack - creature->setFaction(113); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ameAI(creature); - } - - struct npc_ameAI : public npc_escortAI - { - npc_ameAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 DemoralizingShoutTimer; - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 19: - me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO1, me, player); - break; - case 28: - DoScriptText(SAY_SEARCH, me, player); - break; - case 38: - me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO2, me, player); - break; - case 49: - me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO3, me, player); - break; - case 55: - DoScriptText(SAY_FINISH, me, player); - player->GroupEventHappens(QUEST_CHASING_AME, me); - break; - } - } - } - - void Reset() - { - DemoralizingShoutTimer = 5000; - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void JustDied(Unit* /*killer*/) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_CHASING_AME); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - if (!UpdateVictim()) - return; - - if (DemoralizingShoutTimer <= diff) - { - DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); - DemoralizingShoutTimer = 70000; - } else DemoralizingShoutTimer -= diff; - } - }; -}; - -/*#### -# npc_ringo -####*/ - -enum Ringo -{ - SAY_RIN_START_1 = -1000416, - SAY_RIN_START_2 = -1000417, - - SAY_FAINT_1 = -1000418, - SAY_FAINT_2 = -1000419, - SAY_FAINT_3 = -1000420, - SAY_FAINT_4 = -1000421, - - SAY_WAKE_1 = -1000422, - SAY_WAKE_2 = -1000423, - SAY_WAKE_3 = -1000424, - SAY_WAKE_4 = -1000425, - - SAY_RIN_END_1 = -1000426, - SAY_SPR_END_2 = -1000427, - SAY_RIN_END_3 = -1000428, - EMOTE_RIN_END_4 = -1000429, - EMOTE_RIN_END_5 = -1000430, - SAY_RIN_END_6 = -1000431, // signed for 6784 - SAY_SPR_END_7 = -1000432, - EMOTE_RIN_END_8 = -1000433, - - SPELL_REVIVE_RINGO = 15591, - QUEST_A_LITTLE_HELP = 4491, - NPC_SPRAGGLE = 9997, - FACTION_ESCORTEE = 113 -}; - -class npc_ringo : public CreatureScript -{ -public: - npc_ringo() : CreatureScript("npc_ringo") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_A_LITTLE_HELP) - { - if (npc_ringoAI* pRingoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - pRingoAI->StartFollow(player, FACTION_ESCORTEE, quest); - } - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ringoAI(creature); - } - - struct npc_ringoAI : public FollowerAI - { - npc_ringoAI(Creature* creature) : FollowerAI(creature) { } - - uint32 FaintTimer; - uint32 EndEventProgress; - uint32 EndEventTimer; - - uint64 SpraggleGUID; - - void Reset() - { - FaintTimer = urand(30000, 60000); - EndEventProgress = 0; - EndEventTimer = 1000; - SpraggleGUID = 0; - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_SPRAGGLE) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_A_LITTLE_HELP, me); - } - - SpraggleGUID = who->GetGUID(); - SetFollowComplete(true); - } - } - } - - void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) - { - if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO) - ClearFaint(); - } - - void SetFaint() - { - if (!HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - SetFollowPaused(true); - - DoScriptText(RAND(SAY_FAINT_1, SAY_FAINT_2, SAY_FAINT_3, SAY_FAINT_4), me); - } - - //what does actually happen here? Emote? Aura? - me->SetStandState(UNIT_STAND_STATE_SLEEP); - } - - void ClearFaint() - { - me->SetStandState(UNIT_STAND_STATE_STAND); - - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - return; - - DoScriptText(RAND(SAY_WAKE_1, SAY_WAKE_2, SAY_WAKE_3, SAY_WAKE_4), me); - - SetFollowPaused(false); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - if (EndEventTimer <= Diff) - { - Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID); - if (!pSpraggle || !pSpraggle->isAlive()) - { - SetFollowComplete(); - return; - } - - switch (EndEventProgress) - { - case 1: - DoScriptText(SAY_RIN_END_1, me); - EndEventTimer = 3000; - break; - case 2: - DoScriptText(SAY_SPR_END_2, pSpraggle); - EndEventTimer = 5000; - break; - case 3: - DoScriptText(SAY_RIN_END_3, me); - EndEventTimer = 1000; - break; - case 4: - DoScriptText(EMOTE_RIN_END_4, me); - SetFaint(); - EndEventTimer = 9000; - break; - case 5: - DoScriptText(EMOTE_RIN_END_5, me); - ClearFaint(); - EndEventTimer = 1000; - break; - case 6: - DoScriptText(SAY_RIN_END_6, me); - EndEventTimer = 3000; - break; - case 7: - DoScriptText(SAY_SPR_END_7, pSpraggle); - EndEventTimer = 10000; - break; - case 8: - DoScriptText(EMOTE_RIN_END_8, me); - EndEventTimer = 5000; - break; - case 9: - SetFollowComplete(); - break; - } - - ++EndEventProgress; - } - else - EndEventTimer -= Diff; - } - else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED)) - { - if (FaintTimer <= Diff) - { - SetFaint(); - FaintTimer = urand(60000, 120000); - } - else - FaintTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_ungoro_crater() { - new npc_ame(); - new npc_ringo(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index f3b6078d536..0e781c6ddc0 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -131,9 +131,9 @@ bool GrandChampionsOutVehicle(Creature* me) if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3) { - if (!pGrandChampion1->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && - !pGrandChampion2->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && - !pGrandChampion3->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!pGrandChampion1->m_movementInfo.t_guid && + !pGrandChampion2->m_movementInfo.t_guid && + !pGrandChampion3->m_movementInfo.t_guid) return true; } @@ -385,7 +385,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiInterceptTimer <= uiDiff) @@ -529,7 +529,7 @@ public: uiFireBallTimer = 5000; } else uiFireBallTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiFireBallTimer <= uiDiff) @@ -667,7 +667,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiChainLightningTimer <= uiDiff) @@ -813,7 +813,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiLightningArrowsTimer <= uiDiff) @@ -961,7 +961,7 @@ public: } } else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiEviscerateTimer <= uiDiff) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 5d3a6814eb2..9017509781f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -1244,6 +1244,7 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); + OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); } WorldObject* target; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index e2f9faf6a97..0515ba83480 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -357,7 +357,7 @@ class boss_lady_deathwhisper : public CreatureScript void DamageTaken(Unit* /*damageDealer*/, uint32& damage) { // phase transition - if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > me->GetPower(POWER_MANA)) + if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > (uint32)me->GetPower(POWER_MANA)) { Talk(SAY_PHASE_2); Talk(EMOTE_PHASE_2); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 0c5cb0aba52..479d234e27c 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -303,7 +303,7 @@ class npc_coldflame : public CreatureScript { Position const* ownerPos = marrowgarAI->GetLastColdflamePosition(); float ang = me->GetAngle(ownerPos) - static_cast<float>(M_PI); - MapManager::NormalizeOrientation(ang); + ang = MapManager::NormalizeOrientation(ang); me->SetOrientation(ang); owner->GetNearPosition(pos, 2.5f, 0.0f); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 7ada42144a8..79e4684f3a6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -965,6 +965,7 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage); + OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage); } }; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index f2f03ff602b..3a90b6901e3 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -339,6 +339,8 @@ public: me->GetMotionMaster()->MoveLand(0, pos); me->SetDisableGravity(false, true); me->SetHover(true); + me->SetDisableGravity(false, true); + me->SetHover(true); ++introPhase; introTimer = 3000; break; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index f60cc1d188c..cb9f9cbc15c 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -926,8 +926,7 @@ class boss_kaelthas : public CreatureScript unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID()); //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); @@ -953,8 +952,7 @@ class boss_kaelthas : public CreatureScript if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid())) { //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index b213f3df624..0bd7397f1d4 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -317,7 +317,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { if (Player* caster = GetCaster()->ToPlayer()) - if (caster->Has310Flyer(false)) + if (caster->GetSkillValue(SKILL_RIDING) >= 375) amount = 310; } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 9cbf81b39af..a35d243593e 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3027,12 +3027,13 @@ class spell_gen_mount : public SpellScriptLoader break; case 300: if (canFly) - { - if (_mount310 && target->Has310Flyer(false)) - mount = _mount310; - else - mount = _mount280; - } + mount = _mount280; + else + mount = _mount100; + break; + case 375: + if (canFly) + mount = _mount310; else mount = _mount100; break; diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 7830d46260c..4928ec40abd 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1347,24 +1347,6 @@ public: return; if (GetCaster()->GetOwner()->ToPlayer()) { - // Pet's base damage changes depending on happiness - if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet()) - { - switch (GetCaster()->ToPet()->GetHappinessState()) - { - case HAPPY: - // 125% of normal damage - amount += 25.0f; - break; - case CONTENT: - // 100% of normal damage, nothing to modify - break; - case UNHAPPY: - // 75% of normal damage - amount += -25.0f; - break; - } - } // Cobra Reflexes if (AuraEffect* cobraReflexes = GetCaster()->GetAuraEffectOfRankedSpell(61682, EFFECT_0)) amount -= cobraReflexes->GetAmount(); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index ad437c5e431..62a9e9f55d2 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -338,6 +338,9 @@ class spell_rog_deadly_poison : public SpellScriptLoader // item combat enchantments for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) { + if (slot > PRISMATIC_ENCHANTMENT_SLOT || slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot))); if (!enchant) continue; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 175cfb190d7..74f615a87d1 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -211,7 +211,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) { - if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost)) + if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost)) { player->CastSpell(player, triggeredSpellId, true); player->ModifyMoney(-cost); @@ -349,11 +349,11 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui { if (EquippedOk(player, spellId)) { - if (player->HasEnoughMoney(cost)) + if (player->HasEnoughMoney(int64(cost))) { player->CastSpell(player, spellId, true); ProfessionUnlearnSpells(player, spellId); - player->ModifyMoney(-cost); + player->ModifyMoney(-int64(cost)); if (alternativeSpellId) creature->CastSpell(player, alternativeSpellId, true); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 5640a84317c..2d0198bfb0e 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1297,7 +1297,7 @@ public: case GOSSIP_OPTION_LEARNDUALSPEC: if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) { - if (!player->HasEnoughMoney(10000000)) + if (!player->HasEnoughMoney(UI64LIT(10000000))) { player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); player->PlayerTalkClass->SendCloseGossip(); @@ -1305,7 +1305,7 @@ public: } else { - player->ModifyMoney(-10000000); + player->ModifyMoney(SI64LIT(-10000000)); // Cast spells that teach dual spec // Both are also ImplicitTarget self and must be cast by player @@ -2610,11 +2610,11 @@ public: } if (doSwitch) { - if (!player->HasEnoughMoney(EXP_COST)) + if (!player->HasEnoughMoney(uint64(EXP_COST))) player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); else if (noXPGain) { - player->ModifyMoney(-EXP_COST); + player->ModifyMoney(-int64(EXP_COST)); player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); } else if (!noXPGain) |