Merge branch 'master' of https://github.com/TrinityCore/TrinityCore
This commit is contained in:
@@ -312,6 +312,16 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
condMeets = CompareValues(static_cast<ComparisionType>(mConditionValue2), unit->GetHealthPct(), static_cast<float>(mConditionValue1));
|
||||
break;
|
||||
}
|
||||
case CONDITION_WORLD_STATE:
|
||||
{
|
||||
condMeets = mConditionValue2 == sWorld->getWorldState(mConditionValue1);
|
||||
break;
|
||||
}
|
||||
case CONDITION_PHASEMASK:
|
||||
{
|
||||
condMeets = object->GetPhaseMask() & mConditionValue1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
condMeets = false;
|
||||
break;
|
||||
@@ -1673,6 +1683,25 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
case CONDITION_AREAID:
|
||||
case CONDITION_INSTANCE_DATA:
|
||||
break;
|
||||
case CONDITION_WORLD_STATE:
|
||||
{
|
||||
if (!sWorld->getWorldState(cond->mConditionValue1))
|
||||
{
|
||||
sLog->outErrorDb("World state condition has non existing world state in value1 (%u), skipped", cond->mConditionValue1);
|
||||
return false;
|
||||
}
|
||||
if (cond->mConditionValue3)
|
||||
sLog->outErrorDb("World state condition has useless data in value3 (%u)!", cond->mConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_PHASEMASK:
|
||||
{
|
||||
if (cond->mConditionValue2)
|
||||
sLog->outErrorDb("Phasemask condition has useless data in value2 (%u)!", cond->mConditionValue2);
|
||||
if (cond->mConditionValue3)
|
||||
sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->mConditionValue3);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ enum ConditionType
|
||||
CONDITION_QUESTREWARDED = 8, // quest_id 0 0 true if quest_id was rewarded before
|
||||
CONDITION_QUESTTAKEN = 9, // quest_id 0, 0 true while quest active
|
||||
CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, 0 true if player is drunk enough
|
||||
CONDITION_UNUSED_11 = 11,
|
||||
CONDITION_WORLD_STATE = 11, // index value 0 true if world has the value for the index
|
||||
CONDITION_ACTIVE_EVENT = 12, // event_id 0 0 true if event is active
|
||||
CONDITION_INSTANCE_DATA = 13, // entry data 0 true if data is set in current instance
|
||||
CONDITION_QUEST_NONE = 14, // quest_id 0 0 true if doesn't have quest saved
|
||||
@@ -56,7 +56,7 @@ enum ConditionType
|
||||
CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
|
||||
CONDITION_ITEM_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0
|
||||
CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell
|
||||
CONDITION_UNUSED_26 = 26,
|
||||
CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask
|
||||
CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement)
|
||||
CONDITION_QUEST_COMPLETE = 28, // quest_id 0 0 true if player has quest_id with all objectives complete, but not yet rewarded
|
||||
CONDITION_NEAR_CREATURE = 29, // creature entry distance 0 true if there is a creature of entry in range
|
||||
|
||||
@@ -212,12 +212,12 @@ int32 Quest::GetRewOrReqMoney() const
|
||||
|
||||
bool Quest::IsAutoAccept() const
|
||||
{
|
||||
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT) ? false : Flags & QUEST_FLAGS_AUTO_ACCEPT;
|
||||
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_ACCEPT) ? false : (Flags & QUEST_FLAGS_AUTO_ACCEPT);
|
||||
}
|
||||
|
||||
bool Quest::IsAutoComplete() const
|
||||
{
|
||||
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) ? false : Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE);
|
||||
return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) ? false : (Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE));
|
||||
}
|
||||
|
||||
bool Quest::IsAllowedInRaid() const
|
||||
|
||||
@@ -33,7 +33,6 @@ npc_guardian 100% guardianAI used to prevent players from accessin
|
||||
npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 565
|
||||
npc_injured_patient 100% patients for triage-quests (6622 and 6624)
|
||||
npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage)
|
||||
npc_kingdom_of_dalaran_quests Misc NPC's gossip option related to quests 12791, 12794 and 12796
|
||||
npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy
|
||||
npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681
|
||||
npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given
|
||||
@@ -1136,50 +1135,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_kingdom_of_dalaran_quests
|
||||
######*/
|
||||
|
||||
enum eKingdomDalaran
|
||||
{
|
||||
SPELL_TELEPORT_DALARAN = 53360,
|
||||
ITEM_KT_SIGNET = 39740,
|
||||
QUEST_MAGICAL_KINGDOM_A = 12794,
|
||||
QUEST_MAGICAL_KINGDOM_H = 12791,
|
||||
QUEST_MAGICAL_KINGDOM_N = 12796
|
||||
};
|
||||
|
||||
#define GOSSIP_ITEM_TELEPORT_TO "I am ready to be teleported to Dalaran."
|
||||
|
||||
class npc_kingdom_of_dalaran_quests : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_kingdom_of_dalaran_quests() : CreatureScript("npc_kingdom_of_dalaran_quests") { }
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->isQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->HasItemCount(ITEM_KT_SIGNET, 1) && (!player->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_A) ||
|
||||
!player->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_H) || !player->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_N)))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT_TO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
|
||||
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_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, SPELL_TELEPORT_DALARAN, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_mount_vendor
|
||||
######*/
|
||||
@@ -3154,7 +3109,6 @@ void AddSC_npcs_special()
|
||||
new npc_injured_patient;
|
||||
new npc_garments_of_quests;
|
||||
new npc_guardian;
|
||||
new npc_kingdom_of_dalaran_quests;
|
||||
new npc_mount_vendor;
|
||||
new npc_rogue_trainer;
|
||||
new npc_sayge;
|
||||
@@ -3179,4 +3133,3 @@ void AddSC_npcs_special()
|
||||
new npc_firework;
|
||||
new npc_spring_rabbit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user