Core/Unit: don't clear low health aura states on death
Core/Gossip: Fix gossip bug on modify money
Core/Spells: Change the radius of PBAoEs following the feedback received on
Core/Player: update interaction checks, some info taken from client
Core/Spell: abort channeling if no valid targets are found after searching
Core/Creature: fix _DespawnAtEvade saving wrong respawn time
Core/Spell: fixed some problems with per caster aura states
Quickfix a bug introduced by 2f19d97 which prevented GTAoE from being cast.
Core/SmartAI: allow SMART_ACTION_SEND_GOSSIP_MENU to override default gossip
Core/Spell: in case of immunity, check all effects to choose correct procFlags, as none has technically hit
Fix evade issues when a spell hits the target just before evading.
Scripts/Command: implement .debug play music command
Partial revert, Unit::getAttackerForHelper() shouldn't return units that we aren't in combat with (victim can be such a unit for players/player pets, which can startattack from a distance without entering combat).
Fix an issue where CanSpawn would never get invoked on creatures without per-guid script.
Core/Players: fix null dereference crash
This commit is contained in:
hondacrx
2020-06-21 13:01:24 -04:00
parent c1f79334ef
commit 1a2411ae0f
14 changed files with 189 additions and 109 deletions
+18 -5
View File
@@ -791,14 +791,16 @@ namespace Game.AI
public override bool GossipHello(Player player)
{
_gossipReturn = false;
GetScript().ProcessEventsFor(SmartEvents.GossipHello, player);
return false;
return _gossipReturn;
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
_gossipReturn = false;
GetScript().ProcessEventsFor(SmartEvents.GossipSelect, player, menuId, gossipListId);
return false;
return _gossipReturn;
}
public override bool GossipSelectCode(Player player, uint menuId, uint gossipListId, string code)
@@ -993,6 +995,8 @@ namespace Game.AI
public void SetWPPauseTimer(uint time) { mWPPauseTimer = time; }
public void SetGossipReturn(bool val) { _gossipReturn = val; }
bool mIsCharmed;
uint mFollowCreditType;
uint mFollowArrivedTimer;
@@ -1032,6 +1036,9 @@ namespace Game.AI
// Vehicle conditions
bool mHasConditions;
uint mConditionsTimer;
// Gossip
bool _gossipReturn;
}
public class SmartGameObjectAI : GameObjectAI
@@ -1064,15 +1071,16 @@ namespace Game.AI
public override bool GossipHello(Player player, bool reportUse)
{
Log.outDebug(LogFilter.ScriptsAi, "SmartGameObjectAI.GossipHello");
_gossipReturn = false;
GetScript().ProcessEventsFor(SmartEvents.GossipHello, player, reportUse ? 1 : 0u, 0, false, null, me);
return false;
return _gossipReturn;
}
public override bool GossipSelect(Player player, uint menuId, uint gossipListId)
{
_gossipReturn = false;
GetScript().ProcessEventsFor(SmartEvents.GossipSelect, player, menuId, gossipListId, false, null, me);
return false;
return _gossipReturn;
}
public override bool GossipSelectCode(Player player, uint menuId, uint gossipListId, string code)
@@ -1132,9 +1140,14 @@ namespace Game.AI
GetScript().ProcessEventsFor(SmartEvents.SpellHit, unit, 0, 0, false, spellInfo);
}
public void SetGossipReturn(bool val) { _gossipReturn = val; }
public SmartScript GetScript() { return mScript; }
SmartScript mScript;
// Gossip
bool _gossipReturn;
}
public enum SmartEscortState
+7 -1
View File
@@ -2189,7 +2189,7 @@ namespace Game.AI
}
case SmartActions.SendGossipMenu:
{
if (GetBaseObject() == null)
if (GetBaseObject() == null || !IsSmart())
break;
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId {0}, gossipNpcTextId {1}",
@@ -2199,6 +2199,12 @@ namespace Game.AI
if (targets.Empty())
break;
// override default gossip
if (me)
((SmartAI)me.GetAI()).SetGossipReturn(true);
else if (go)
((SmartGameObjectAI)go.GetAI()).SetGossipReturn(true);
foreach (var obj in targets)
{
Player player = obj.ToPlayer();