Core/PacketIO: Implemented CMSG_CONVERSATION_LINE_STARTED
Port From (https://github.com/TrinityCore/TrinityCore/commit/6d9ce8e8baa100ecc7650d0ae56037c131bab2e0)
This commit is contained in:
@@ -760,7 +760,7 @@ namespace Game.Scripting
|
||||
public virtual AreaTriggerAI GetAI(AreaTrigger at) { return null; }
|
||||
}
|
||||
|
||||
class ConversationScript : ScriptObject
|
||||
public class ConversationScript : ScriptObject
|
||||
{
|
||||
public ConversationScript(string name) : base(name)
|
||||
{
|
||||
@@ -771,6 +771,9 @@ namespace Game.Scripting
|
||||
|
||||
// Called when Conversation is created but not added to Map yet.
|
||||
public virtual void OnConversationCreate(Conversation conversation, Unit creator) { }
|
||||
|
||||
// Called when player sends CMSG_CONVERSATION_LINE_STARTED with valid conversation guid
|
||||
public virtual void OnConversationLineStarted(Conversation conversation, uint lineId, Player sender) { }
|
||||
}
|
||||
|
||||
public class SceneScript : ScriptObject
|
||||
|
||||
@@ -1117,6 +1117,14 @@ namespace Game.Scripting
|
||||
RunScript<ConversationScript>(script => script.OnConversationCreate(conversation, creator), conversation.GetScriptId());
|
||||
}
|
||||
|
||||
public void OnConversationLineStarted(Conversation conversation, uint lineId, Player sender)
|
||||
{
|
||||
Cypher.Assert(conversation != null);
|
||||
Cypher.Assert(sender != null);
|
||||
|
||||
RunScript<ConversationScript>(script => script.OnConversationLineStarted(conversation, lineId, sender), conversation.GetScriptId());
|
||||
}
|
||||
|
||||
//SceneScript
|
||||
public void OnSceneStart(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user