Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Mantella spells from game events and accounted for food and drink consumption #83

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions Scripts/Source/MantellaListenerScript.psc
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,12 @@ endEvent


Event OnSpellCast(Form akSpell)
if repository.playerTrackingOnSpellCast
string spellCast = (akSpell as form).getname()
if spellCast
if spellCast == "Mantella"
; Do not save event if Mantella itself is cast
else
if (repository.playerTrackingOnSpellCast)
string spellCast = (akSpell as form).getname()
if spellCast
if (spellCast != "Mantella") && (spellCast != "Mantella Remove NPC") && (spellCast != "Mantella End Conversation")
;Debug.Notification("The player casted the spell "+ spellCast)
AddIngameEventToConversation(getPlayerName() + " casted the spell " + spellCast )
AddIngameEventToConversation(getPlayerName() + " casted the spell / consumed " + spellCast )
endIf
endIf
endif
Expand All @@ -169,7 +167,7 @@ Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile,

; avoid writing events too often (continuous spells record very frequently)
; if the actor and weapon hasn't changed, only record the event every 5 hits
if ((hitSource != lastHitSource) && (aggressor != lastAggressor)) || (timesHitSameAggressorSource > 5)
if ((hitSource != lastHitSource) && (aggressor != lastAggressor)) || (timesHitSameAggressorSource > 5) && (hitSource != "Mantella") && (hitSource != "Mantella Remove NPC") && (hitSource != "Mantella End Conversation")
lastHitSource = hitSource
lastAggressor = aggressor
timesHitSameAggressorSource = 0
Expand Down Expand Up @@ -207,17 +205,23 @@ endEvent
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
if repository.playerTrackingOnObjectEquipped
string itemEquipped = akBaseObject.getname()
;Debug.MessageBox("The player equipped " + itemEquipped)
AddIngameEventToConversation(getPlayerName() + " equipped " + itemEquipped )

if (itemEquipped != "Mantella") && (itemEquipped != "Mantella Remove NPC") && (itemEquipped != "Mantella End Conversation")
;Debug.MessageBox("The player equipped " + itemEquipped)
AddIngameEventToConversation(getPlayerName() + " equipped " + itemEquipped)
endIf
endif
endEvent


Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)
if repository.playerTrackingOnObjectUnequipped
string itemUnequipped = akBaseObject.getname()
;Debug.MessageBox("The player unequipped " + itemUnequipped)
AddIngameEventToConversation(getPlayerName() + " unequipped " + itemUnequipped )

if (itemUnequipped != "Mantella") && (itemUnequipped != "Mantella Remove NPC") && (itemUnequipped != "Mantella End Conversation")
;Debug.MessageBox("The player unequipped " + itemUnequipped)
AddIngameEventToConversation(getPlayerName() + " unequipped " + itemUnequipped )
endIf
endif
endEvent

Expand Down