Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Removed duplication in events and rearranged the xml order (#341)
Browse files Browse the repository at this point in the history
Removed duplication in events and rearranged the xml order.

If implement Creature:onAreaCombat or Creature:onTargetCombat should not work, because has another implementation below, that way he will overwrite the first one.
  • Loading branch information
gpedro committed Jan 17, 2022
1 parent 5f004ad commit 44d75fe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
38 changes: 19 additions & 19 deletions data/events/events.xml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<events>
<!-- Creature Methods -->
<event class="Creature" method="onChangeOutfit" enabled="1" />
<event class="Creature" method="onAreaCombat" enabled="0" />
<event class="Creature" method="onTargetCombat" enabled="1" /><!-- removeCombatProtection on secure modes protection -->
<event class="Creature" method="onChangeOutfit" enabled="1" />
<event class="Creature" method="onDrainHealth" enabled="1" />
<event class="Creature" method="onHear" enabled="0" />
<event class="Creature" method="onTargetCombat" enabled="1" /><!-- removeCombatProtection on secure modes protection -->

<!-- Monster Methods -->
<event class="Monster" method="onDropLoot" enabled="1" />
<event class="Monster" method="onSpawn" enabled="1" />

<!-- Party Methods -->
<event class="Party" method="onDisband" enabled="0" />
<event class="Party" method="onJoin" enabled="0" />
<event class="Party" method="onLeave" enabled="0" />
<event class="Party" method="onDisband" enabled="0" />
<event class="Party" method="onShareExperience" enabled="1" />

<!-- Player Methods -->
<event class="Player" method="onBrowseField" enabled="0" />
<event class="Player" method="onChangeZone" enabled="1" />
<event class="Player" method="onGainExperience" enabled="1" />
<event class="Player" method="onGainSkillTries" enabled="1" />
<event class="Player" method="onItemMoved" enabled="0" />
<event class="Player" method="onLook" enabled="1" />
<event class="Player" method="onLookInBattleList" enabled="1" />
<event class="Player" method="onLookInTrade" enabled="1" />
<event class="Player" method="onLookInShop" enabled="0" />
<event class="Player" method="onMoveItem" enabled="1" /><!-- Protections on rewardsystem and global depots -->
<event class="Player" method="onItemMoved" enabled="0" />
<event class="Player" method="onChangeZone" enabled="1" />
<event class="Player" method="onLookInTrade" enabled="1" />
<event class="Player" method="onLoseExperience" enabled="0" />
<event class="Player" method="onMoveCreature" enabled="1" />
<event class="Player" method="onMoveItem" enabled="1" /><!-- Protections on rewardsystem and global depots -->
<event class="Player" method="onReportBug" enabled="1" />
<event class="Player" method="onReportRuleViolation" enabled="1" />
<event class="Player" method="onTurn" enabled="1" /><!-- Move with ( ctrl + arrows ) like to TFS 0.3.x : 0.4 -->
<event class="Player" method="onTradeRequest" enabled="1" /><!-- Move with ( ctrl + arrows ) like to TFS 0.3.x : 0.4 -->
<event class="Player" method="onTradeAccept" enabled="1" />
<event class="Player" method="onGainExperience" enabled="1" />
<event class="Player" method="onLoseExperience" enabled="0" />
<event class="Player" method="onGainSkillTries" enabled="1" />
<event class="Player" method="onRequestQuestLog" enabled="1" />
<event class="Player" method="onRequestQuestLine" enabled="1" />
<event class="Player" method="onRequestQuestLog" enabled="1" />
<event class="Player" method="onStorageUpdate" enabled="1" />
<event class="Player" method="onTradeAccept" enabled="1" />
<event class="Player" method="onTradeRequest" enabled="1" /><!-- Move with ( ctrl + arrows ) like to TFS 0.3.x : 0.4 -->
<event class="Player" method="onTurn" enabled="1" /><!-- Move with ( ctrl + arrows ) like to TFS 0.3.x : 0.4 -->
<event class="Player" method="onCombat" enabled="1" />

<event class="Creature" method="onDrainHealth" enabled="1" />
<event class="Player" method="onRemoveCount" enabled="1" /><!-- Tibia 11 function -->

<!-- Monster Methods -->
<event class="Monster" method="onDropLoot" enabled="1" />
<event class="Monster" method="onSpawn" enabled="1" />
</events>
8 changes: 0 additions & 8 deletions data/events/scripts/creature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ function Creature:onChangeOutfit(outfit)
return true
end

function Creature:onAreaCombat(tile, isAggressive)
return RETURNVALUE_NOERROR
end

function Creature:onTargetCombat(target)
return RETURNVALUE_NOERROR
end

function Creature:onHear(speaker, words, type)
end

Expand Down

0 comments on commit 44d75fe

Please sign in to comment.