mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
naxx chat short cut
This commit is contained in:
@@ -164,6 +164,7 @@ class ChatActionContext : public NamedObjectContext<Action>
|
||||
creators["guild remove"] = &ChatActionContext::guild_remove;
|
||||
creators["guild leave"] = &ChatActionContext::guild_leave;
|
||||
creators["rtsc"] = &ChatActionContext::rtsc;
|
||||
creators["naxx chat shortcut"] = &ChatActionContext::naxx_chat_shortcut;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -253,6 +254,7 @@ class ChatActionContext : public NamedObjectContext<Action>
|
||||
static Action* guild_remove(PlayerbotAI* botAI) { return new GuildRemoveAction(botAI); }
|
||||
static Action* guild_leave(PlayerbotAI* botAI) { return new GuildLeaveAction(botAI); }
|
||||
static Action* rtsc(PlayerbotAI* botAI) { return new RTSCAction(botAI); }
|
||||
static Action* naxx_chat_shortcut(PlayerbotAI* ai) { return new NaxxChatShortcutAction(ai); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -188,3 +188,16 @@ bool MaxDpsChatShortcutAction::Execute(Event event)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NaxxChatShortcutAction::Execute(Event event)
|
||||
{
|
||||
Player* master = GetMaster();
|
||||
if (!master)
|
||||
return false;
|
||||
|
||||
botAI->Reset();
|
||||
botAI->ChangeStrategy("+naxx", BOT_STATE_NON_COMBAT);
|
||||
botAI->ChangeStrategy("+naxx", BOT_STATE_COMBAT);
|
||||
bot->Say("Add Naxx Strategies!", LANG_UNIVERSAL);
|
||||
return true;
|
||||
}
|
||||
@@ -74,4 +74,10 @@ class MaxDpsChatShortcutAction : public Action
|
||||
bool Execute(Event event) override;
|
||||
};
|
||||
|
||||
class NaxxChatShortcutAction : public Action
|
||||
{
|
||||
public:
|
||||
NaxxChatShortcutAction(PlayerbotAI* ai) : Action(ai, "naxx chat shortcut") {}
|
||||
virtual bool Execute(Event event);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -28,8 +28,8 @@ float CastTimeMultiplier::GetValue(Action* action)
|
||||
return 1.0f;
|
||||
|
||||
uint32 castTime = spellInfo->CalcCastTime();
|
||||
if (castTime >= 3000)
|
||||
return 0.0f;
|
||||
// if (castTime >= 3000)
|
||||
// return 0.0f;
|
||||
|
||||
if (castTime >= 1500)
|
||||
return 0.5f;
|
||||
|
||||
@@ -58,6 +58,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
|
||||
triggers.push_back(new TriggerNode("attackers", NextAction::array(0, new NextAction("tell attackers", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("target", NextAction::array(0, new NextAction("tell target", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("ready", NextAction::array(0, new NextAction("ready check", relevance), nullptr)));
|
||||
triggers.push_back(new TriggerNode("naxx", NextAction::array(0, new NextAction("naxx chat shortcut", relevance), NULL)));
|
||||
}
|
||||
|
||||
ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
|
||||
|
||||
@@ -112,6 +112,7 @@ class ChatTriggerContext : public NamedObjectContext<Trigger>
|
||||
creators["guild leave"] = &ChatTriggerContext::guild_leave;
|
||||
creators["rtsc"] = &ChatTriggerContext::rtsc;
|
||||
creators["drink"] = &ChatTriggerContext::drink;
|
||||
creators["naxx"] = &ChatTriggerContext::naxx;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -204,6 +205,7 @@ class ChatTriggerContext : public NamedObjectContext<Trigger>
|
||||
static Trigger* guild_leave(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "guild leave"); }
|
||||
static Trigger* rtsc(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "rtsc"); }
|
||||
static Trigger* drink(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "drink"); }
|
||||
static Trigger* naxx(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "naxx"); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user