More refactoring of code.
This commit is contained in:
@@ -235,7 +235,7 @@ namespace Game.AI
|
||||
Group group = player.GetGroup();
|
||||
if (group)
|
||||
{
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next())
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next())
|
||||
{
|
||||
Player groupGuy = groupRef.GetSource();
|
||||
if (!groupGuy.IsInMap(player))
|
||||
@@ -399,7 +399,7 @@ namespace Game.AI
|
||||
Group group = player.GetGroup();
|
||||
if (group)
|
||||
{
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next())
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next())
|
||||
{
|
||||
Player groupGuy = groupRef.GetSource();
|
||||
if (groupGuy.IsInMap(player) && me.GetDistance(groupGuy) <= checkDist)
|
||||
@@ -800,29 +800,29 @@ namespace Game.AI
|
||||
mEvadeDisabled = disable;
|
||||
}
|
||||
|
||||
public override void sGossipHello(Player player)
|
||||
public override void GossipHello(Player player)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.GossipHello, player);
|
||||
}
|
||||
|
||||
public override void sGossipSelect(Player player, uint menuId, uint gossipListId)
|
||||
public override void GossipSelect(Player player, uint menuId, uint gossipListId)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.GossipSelect, player, menuId, gossipListId);
|
||||
}
|
||||
|
||||
public override void sGossipSelectCode(Player player, uint menuId, uint gossipListId, string code) { }
|
||||
public override void GossipSelectCode(Player player, uint menuId, uint gossipListId, string code) { }
|
||||
|
||||
public override void sQuestAccept(Player player, Quest quest)
|
||||
public override void QuestAccept(Player player, Quest quest)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.AcceptedQuest, player, quest.Id);
|
||||
}
|
||||
|
||||
public override void sQuestReward(Player player, Quest quest, uint opt)
|
||||
public override void QuestReward(Player player, Quest quest, uint opt)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.RewardQuest, player, quest.Id, opt);
|
||||
}
|
||||
|
||||
public override bool sOnDummyEffect(Unit caster, uint spellId, int effIndex)
|
||||
public override bool OnDummyEffect(Unit caster, uint spellId, int effIndex)
|
||||
{
|
||||
GetScript().ProcessEventsFor(SmartEvents.DummyEffect, caster, spellId, (uint)effIndex);
|
||||
return true;
|
||||
@@ -916,7 +916,7 @@ namespace Game.AI
|
||||
GetScript().SetScript9(e, entry);
|
||||
}
|
||||
|
||||
public override void sOnGameEvent(bool start, ushort eventId)
|
||||
public override void OnGameEvent(bool start, ushort eventId)
|
||||
{
|
||||
GetScript().ProcessEventsFor(start ? SmartEvents.GameEventStart : SmartEvents.GameEventEnd, null, eventId);
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ namespace Game.AI
|
||||
case SmartEvents.GameEventEnd:
|
||||
{
|
||||
var events = Global.GameEventMgr.GetEventMap();
|
||||
if (e.Event.gameEvent.gameEventId >= events.Length || !events[e.Event.gameEvent.gameEventId].isValid())
|
||||
if (e.Event.gameEvent.gameEventId >= events.Length || !events[e.Event.gameEvent.gameEventId].IsValid())
|
||||
return false;
|
||||
|
||||
break;
|
||||
@@ -1139,7 +1139,7 @@ namespace Game.AI
|
||||
}
|
||||
|
||||
GameEventData eventData = events[eventId];
|
||||
if (!eventData.isValid())
|
||||
if (!eventData.IsValid())
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "SmartAIMgr: Entry {0} SourceType {1} Event {2} Action {3} uses non-existent event, eventId {4}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.Action.gameEventStop.id);
|
||||
return false;
|
||||
@@ -1158,7 +1158,7 @@ namespace Game.AI
|
||||
}
|
||||
|
||||
GameEventData eventData = events[eventId];
|
||||
if (!eventData.isValid())
|
||||
if (!eventData.IsValid())
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "SmartAIMgr: Entry {0} SourceType {1} Event {2} Action {3} uses non-existent event, eventId {4}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.Action.gameEventStart.id);
|
||||
return false;
|
||||
|
||||
@@ -392,13 +392,13 @@ namespace Game.AI
|
||||
if (me == null)
|
||||
break;
|
||||
|
||||
var threatList = me.GetThreatManager().getThreatList();
|
||||
var threatList = me.GetThreatManager().GetThreatList();
|
||||
foreach (var refe in threatList)
|
||||
{
|
||||
Unit target = Global.ObjAccessor.GetUnit(me, refe.getUnitGuid());
|
||||
Unit target = Global.ObjAccessor.GetUnit(me, refe.GetUnitGuid());
|
||||
if (target != null)
|
||||
{
|
||||
me.GetThreatManager().modifyThreatPercent(target, e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC);
|
||||
me.GetThreatManager().ModifyThreatPercent(target, e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC);
|
||||
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_THREAT_ALL_PCT: Creature guidLow {0} modify threat for unit {1}, value {2}",
|
||||
me.GetGUID().ToString(), target.GetGUID().ToString(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC);
|
||||
}
|
||||
@@ -418,7 +418,7 @@ namespace Game.AI
|
||||
{
|
||||
if (IsUnit(obj))
|
||||
{
|
||||
me.GetThreatManager().modifyThreatPercent(obj.ToUnit(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC);
|
||||
me.GetThreatManager().ModifyThreatPercent(obj.ToUnit(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC);
|
||||
Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow {0} modify threat for unit {1}, value {2}",
|
||||
me.GetGUID().ToString(), obj.GetGUID().ToString(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC);
|
||||
}
|
||||
@@ -2913,7 +2913,7 @@ namespace Game.AI
|
||||
Group group = player.GetGroup();
|
||||
if (group)
|
||||
{
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next())
|
||||
for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next())
|
||||
{
|
||||
Player member = groupRef.GetSource();
|
||||
if (member)
|
||||
@@ -3118,10 +3118,10 @@ namespace Game.AI
|
||||
{
|
||||
if (me != null)
|
||||
{
|
||||
var threatList = me.GetThreatManager().getThreatList();
|
||||
var threatList = me.GetThreatManager().GetThreatList();
|
||||
foreach (var i in threatList)
|
||||
{
|
||||
Unit temp = Global.ObjAccessor.GetUnit(me, i.getUnitGuid());
|
||||
Unit temp = Global.ObjAccessor.GetUnit(me, i.GetUnitGuid());
|
||||
if (temp != null)
|
||||
if (e.Target.hostilRandom.maxDist == 0 || me.IsWithinCombatRange(temp, (float)e.Target.hostilRandom.maxDist))
|
||||
l.Add(temp);
|
||||
@@ -3157,7 +3157,7 @@ namespace Game.AI
|
||||
Group lootGroup = me.GetLootRecipientGroup();
|
||||
if (lootGroup)
|
||||
{
|
||||
for (GroupReference refe = lootGroup.GetFirstMember(); refe != null; refe = refe.next())
|
||||
for (GroupReference refe = lootGroup.GetFirstMember(); refe != null; refe = refe.Next())
|
||||
{
|
||||
Player recipient = refe.GetSource();
|
||||
if (recipient)
|
||||
|
||||
Reference in New Issue
Block a user