Skip to content

Commit

Permalink
Feat: Finalise all Coffre New implementaions + implement TeleportNPC …
Browse files Browse the repository at this point in the history
…& TextNPC linkage to territories + other merges:

- Finalize Switches for coffres (events, switches family and order combinations)
- Finalize Coffres that can respawn to TPPoints
- Link TeleportNPC & TextNPC to territories as a new condition
- Merge: display the name of the dead enemy on being hit instead of "a dead enemy"
- Merge: fix offensive cast AI
- Merge: fix: fix setting item price in market
- Merge: misc: remove tax on TemporaryConsignmentMerchant items
  • Loading branch information
DOL-Avalonia committed Jun 2, 2024
1 parent 732dd84 commit 04e4e02
Show file tree
Hide file tree
Showing 23 changed files with 422 additions and 117 deletions.
1 change: 1 addition & 0 deletions GameServer/GameEvents/EventStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public enum EventStatus
EndedByEventStarting,
EndedByAreaEvent,
EndedByTextNPC,
EndedBySwitch
}
}
21 changes: 10 additions & 11 deletions GameServer/GameEvents/GameEventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,10 @@ public List<string> GetEventsInfos(bool isPlayer, bool showAllEvents)
return infos;
}


public GameEvent GetEventByID(string eventID)
{
return Events.FirstOrDefault(e => e.ID == eventID);
}

private void GetMainInformations(GameEvent e, List<string> infos)
{
Expand Down Expand Up @@ -1098,6 +1101,12 @@ public async Task StopEvent(GameEvent e, EndingConditionType end)
await ShowEndEffects(e);
CleanEvent(e);
}
else if (end == EndingConditionType.Switch)
{
e.Status = EventStatus.EndedBySwitch;
await ShowEndEffects(e);
CleanEvent(e);
}

var eventsCount = GameEventManager.Instance.Events.Where(ev => ev.ID.Equals(e.ID)).Count();
if (eventsCount == 1)
Expand Down Expand Up @@ -1396,15 +1405,5 @@ private IEnumerable<string> SearchDependencies(string id)

return ev.Select(e => e.ID);
}

/*public List<GameEvent> GetEventsBySwitchFamily(string switchFamily)
{
return Events.Where(e => e.SwitchFamily == switchFamily).ToList();
}*/

public GameEvent GetEventByID(string eventID)
{
return Events.FirstOrDefault(e => e.ID == eventID);
}
}
}
2 changes: 1 addition & 1 deletion GameServer/Territory/TerritoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void TerritoryAttacked(Territory territory)
timer.Elapsed += TerritoryAttackedCallback;
timer.Enabled = true;
m_TerritoriesAttacked.Add(timer, territory);
territory.OwnerGuild?.SendMessageToGuildMembersKey("TerritoryManager.Territory.Attacked", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow, territory.Name);
territory.OwnerGuild?.SendMessageToGuildMembersKey("TerritoryManager.Territory.Attacked", eChatType.CT_Important, eChatLoc.CL_SystemWindow, territory.Name);
}
}

Expand Down
76 changes: 70 additions & 6 deletions GameServer/_scripts/AmteScripts/GameObjects/Coffre/DBCoffre.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,21 @@ public static void OnServerStarted(DOLEvent e, object sender, EventArgs args)
private int m_coffreOpeningInterval;
private string m_eventID;
private List<string> m_removedByEventID;
private ushort m_tpid;
private int m_tpid;
private bool m_shouldrespawntotpid;
protected int m_currentStep;
private bool m_pickontouch;
private int m_keyLoseDur;
private string m_switchFamily;
private int m_switchOrder;
private bool m_isSwitch;
private bool m_wrongorderresetfamily;
private int m_secondarymodel;
private int m_activatedDuration;
private string m_switchTriggerEventID;
private string m_activatedbyswitchon;
private string m_activatedbyswitchoff;
private string m_resetbyswitchon;
private string m_resetbyswitchoff;

[DataElement(AllowDbNull = false)]
public string Name
Expand Down Expand Up @@ -545,7 +550,7 @@ public string RemovedByEventID
}

[DataElement(AllowDbNull = true)]
public ushort TPID
public int TPID
{
get
{
Expand Down Expand Up @@ -573,6 +578,17 @@ public bool ShouldRespawnToTPID
}
}

[DataElement(AllowDbNull = true)]
public int CurrentStep
{
get { return m_currentStep; }
set
{
Dirty = true;
m_currentStep = value;
}
}

[DataElement(AllowDbNull = false)]
public bool PickOnTouch
{
Expand Down Expand Up @@ -650,6 +666,21 @@ public bool IsSwitch
}
}

[DataElement(AllowDbNull = false)]
public bool WrongOrderResetFamily
{
get
{
return m_wrongorderresetfamily;
}

set
{
Dirty = true;
m_wrongorderresetfamily = value;
}
}

[DataElement(AllowDbNull = false)]
public int SecondaryModel
{
Expand All @@ -676,13 +707,46 @@ public int ActivatedDuration
}

[DataElement(AllowDbNull = true, Varchar = 255)]
public string SwitchTriggerEventID
public string ActivatedBySwitchOn
{
get => m_activatedbyswitchon;
set
{
Dirty = true;
m_activatedbyswitchon = value;
}
}

[DataElement(AllowDbNull = true, Varchar = 255)]
public string ActivatedBySwitchOff
{
get => m_activatedbyswitchoff;
set
{
Dirty = true;
m_activatedbyswitchoff = value;
}
}

[DataElement(AllowDbNull = true, Varchar = 255)]
public string ResetBySwitchOn
{
get => m_resetbyswitchon;
set
{
Dirty = true;
m_resetbyswitchon = value;
}
}

[DataElement(AllowDbNull = true, Varchar = 255)]
public string ResetBySwitchOff
{
get => m_switchTriggerEventID;
get => m_resetbyswitchoff;
set
{
Dirty = true;
m_switchTriggerEventID = value;
m_resetbyswitchoff = value;
}
}
}
Expand Down
Loading

0 comments on commit 04e4e02

Please sign in to comment.