mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts: src/server/scripts/Kalimdor/thousand_needles.cpp
This commit is contained in:
@@ -46,6 +46,14 @@ public:
|
||||
{ "email", SEC_GAMEMASTER, true, &HandleLookupPlayerEmailCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand lookupSpellCommandTable[] =
|
||||
{
|
||||
{ "id", SEC_ADMINISTRATOR, true, &HandleLookupSpellIdCommand, "", NULL },
|
||||
{ "", SEC_ADMINISTRATOR, true, &HandleLookupSpellCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand lookupCommandTable[] =
|
||||
{
|
||||
{ "area", SEC_MODERATOR, true, &HandleLookupAreaCommand, "", NULL },
|
||||
@@ -58,13 +66,14 @@ public:
|
||||
{ "quest", SEC_ADMINISTRATOR, true, &HandleLookupQuestCommand, "", NULL },
|
||||
{ "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable },
|
||||
{ "skill", SEC_ADMINISTRATOR, true, &HandleLookupSkillCommand, "", NULL },
|
||||
{ "spell", SEC_ADMINISTRATOR, true, &HandleLookupSpellCommand, "", NULL },
|
||||
{ "spell", SEC_ADMINISTRATOR, true, NULL, "", lookupSpellCommandTable },
|
||||
{ "taxinode", SEC_ADMINISTRATOR, true, &HandleLookupTaxiNodeCommand, "", NULL },
|
||||
{ "tele", SEC_MODERATOR, true, &HandleLookupTeleCommand, "", NULL },
|
||||
{ "title", SEC_GAMEMASTER, true, &HandleLookupTitleCommand, "", NULL },
|
||||
{ "map", SEC_ADMINISTRATOR, true, &HandleLookupMapCommand, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand commandTable[] =
|
||||
{
|
||||
{ "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable },
|
||||
@@ -850,6 +859,94 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleLookupSpellIdCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
// can be NULL at console call
|
||||
Player* target = handler->getSelectedPlayer();
|
||||
|
||||
uint32 id = atoi((char*)args);
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = 1;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
|
||||
if (spellInfo)
|
||||
{
|
||||
int locale = handler->GetSessionDbcLocale();
|
||||
std::string name = spellInfo->SpellName[locale];
|
||||
if (name.empty())
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (locale < TOTAL_LOCALES)
|
||||
{
|
||||
if (maxResults && count++ == maxResults)
|
||||
{
|
||||
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);
|
||||
|
||||
SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell);
|
||||
|
||||
uint32 talentCost = GetTalentSpellCost(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();
|
||||
|
||||
// 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;
|
||||
|
||||
if (handler->GetSession())
|
||||
ss << ' ' << localeNames[locale] << "]|h|r";
|
||||
else
|
||||
ss << ' ' << localeNames[locale];
|
||||
|
||||
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());
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleLookupTaxiNodeCommand(ChatHandler* handler, const char * args)
|
||||
{
|
||||
if (!*args)
|
||||
|
||||
@@ -585,6 +585,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* ravager = go->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true))
|
||||
@@ -740,6 +741,7 @@ class go_bristlelimb_cage : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
if (player->GetQuestStatus(QUEST_THE_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* capitive = go->FindNearestCreature(NPC_STILLPINE_CAPITIVE, 5.0f, true))
|
||||
|
||||
@@ -168,9 +168,9 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
if (Creature* stillpine = go->FindNearestCreature(NPC_PRINCESS_STILLPINE, 25, true))
|
||||
{
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
stillpine->GetMotionMaster()->MovePoint(1, go->GetPositionX(), go->GetPositionY()-15, go->GetPositionZ());
|
||||
player->CastedCreatureOrGO(NPC_PRINCESS_STILLPINE, 0, SPELL_OPENING_PRINCESS_STILLPINE_CREDIT);
|
||||
}
|
||||
|
||||
@@ -748,9 +748,9 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (Creature* prisoner = go->FindNearestCreature(NPC_THERAMORE_PRISONER, 1.0f))
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_THERAMORE_PRISONER, 0);
|
||||
|
||||
|
||||
@@ -1398,12 +1398,12 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_OUR_ONLY_HOPE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
Creature* pGymerDummy = go->FindNearestCreature(NPC_GYMER_DUMMY, 20.0f);
|
||||
if (pGymerDummy)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
player->KilledMonsterCredit(pGymerDummy->GetEntry(), pGymerDummy->GetGUID());
|
||||
pGymerDummy->CastSpell(pGymerDummy, 55529, true);
|
||||
pGymerDummy->DisappearAndDie();
|
||||
|
||||
@@ -388,11 +388,11 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
if (go->GetEntry() == GO_CORKIS_PRISON)
|
||||
{
|
||||
if (Creature* corki = go->FindNearestCreature(NPC_CORKI, 25, true))
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ());
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0);
|
||||
@@ -403,7 +403,6 @@ public:
|
||||
{
|
||||
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true))
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()-5, go->GetPositionY(), go->GetPositionZ());
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_CORKI_2, 0);
|
||||
@@ -414,7 +413,6 @@ public:
|
||||
{
|
||||
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true))
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+4, go->GetPositionY(), go->GetPositionZ());
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_CORKI_CREDIT_3, 0);
|
||||
@@ -683,12 +681,12 @@ class go_warmaul_prison : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_FINDING_THE_SURVIVORS) != QUEST_STATUS_INCOMPLETE)
|
||||
return false;
|
||||
|
||||
if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f))
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
|
||||
|
||||
prisoner->AI()->Talk(SAY_FREE, player->GetGUID());
|
||||
|
||||
@@ -1052,12 +1052,10 @@ class go_captain_tyralius_prison : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (Creature* tyralius = go->FindNearestCreature(NPC_CAPTAIN_TYRALIUS, 1.0f))
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
|
||||
player->KilledMonsterCredit(NPC_CAPTAIN_TYRALIUS, 0);
|
||||
|
||||
tyralius->AI()->Talk(SAY_FREE);
|
||||
tyralius->DespawnOrUnsummon(8000);
|
||||
}
|
||||
|
||||
@@ -309,6 +309,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32));
|
||||
|
||||
if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player),
|
||||
@@ -358,6 +359,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32));
|
||||
|
||||
player->SummonCreature(NpcStasisEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player),
|
||||
@@ -729,9 +731,9 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (Creature* pNearestPrisoner = go->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true))
|
||||
{
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
player->KilledMonsterCredit(NPC_SCOURGE_PRISONER, pNearestPrisoner->GetGUID());
|
||||
pNearestPrisoner->DisappearAndDie();
|
||||
}
|
||||
@@ -811,6 +813,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
|
||||
if (!pPrisoner)
|
||||
{
|
||||
@@ -1047,6 +1050,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE)
|
||||
return true;
|
||||
|
||||
@@ -1094,12 +1098,12 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
Creature* pTadpole = go->FindNearestCreature(NPC_WINTERFIN_TADPOLE, 1.0f);
|
||||
if (pTadpole)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
pTadpole->DisappearAndDie();
|
||||
player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0);
|
||||
//FIX: Summon minion tadpole
|
||||
@@ -1229,13 +1233,12 @@ class go_gjalerbron_cage : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE))
|
||||
{
|
||||
if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f))
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0);
|
||||
|
||||
@@ -1258,6 +1261,7 @@ class go_large_gjalerbron_cage : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) ||
|
||||
(player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE))
|
||||
{
|
||||
@@ -1265,7 +1269,6 @@ class go_large_gjalerbron_cage : public GameObjectScript
|
||||
GetCreatureListWithEntryInGrid(prisonerList, go, NPC_GJALERBRON_PRISONER, INTERACTION_DISTANCE);
|
||||
for (std::list<Creature*>::const_iterator itr = prisonerList.begin(); itr != prisonerList.end(); ++itr)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID());
|
||||
(*itr)->DespawnOrUnsummon(6000);
|
||||
(*itr)->AI()->Talk(SAY_FREE);
|
||||
@@ -1293,13 +1296,13 @@ class go_veil_skith_cage : public GameObjectScript
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
std::list<Creature*> childrenList;
|
||||
GetCreatureListWithEntryInGrid(childrenList, go, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE);
|
||||
for (std::list<Creature*>::const_iterator itr = childrenList.begin(); itr != childrenList.end(); ++itr)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID());
|
||||
(*itr)->DespawnOrUnsummon(5000);
|
||||
(*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ());
|
||||
@@ -1330,10 +1333,10 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton(10);
|
||||
if (!player->HasAura(SPELL_RECENT_MEDITATION))
|
||||
if (player->GetQuestStatus(QUEST_THE_CLEANSING_HORDE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_THE_CLEANSING_ALLIANCE) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
go->UseDoorOrButton(10);
|
||||
player->CastSpell(player, SPELL_CLEANSING_SOUL);
|
||||
player->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user