• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent [TFS 1.3 / 1.4] Upgrade System

For anybody having issue with login stats change ...
Diff:
--- upgrade_system_core.lua
+++ upgrade_system_core.lua
@@ -474,6 +474,9 @@
   player:registerEvent("UpgradeSystemHealth")
   player:registerEvent("UpgradeSystemMana")
   player:registerEvent("UpgradeSystemPD")
+
+  local loginHP = player:getHealth()
+  local loginMP = player:getMana()
 
   local maxHP = player:getMaxHealth()
   local maxMP = player:getMaxMana()
@@ -536,6 +539,14 @@
       end
     end
   end
+  local currentHP = player:getHealth()
+  if(currentHP <= loginHP) then
+    player:addHealth(loginHP - currentHP)
+  end
+  local currentMP = player:getMana()
+  if(currentMP <= loginMP) then
+    player:addMana(loginMP - currentMP)
+  end
 end
 
 function us_onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
 
For anybody having issue with login stats change ...
Diff:
--- upgrade_system_core.lua
+++ upgrade_system_core.lua
@@ -474,6 +474,9 @@
   player:registerEvent("UpgradeSystemHealth")
   player:registerEvent("UpgradeSystemMana")
   player:registerEvent("UpgradeSystemPD")
+
+  local loginHP = player:getHealth()
+  local loginMP = player:getMana()
 
   local maxHP = player:getMaxHealth()
   local maxMP = player:getMaxMana()
@@ -536,6 +539,14 @@
       end
     end
   end
+  local currentHP = player:getHealth()
+  if(currentHP <= loginHP) then
+    player:addHealth(loginHP - currentHP)
+  end
+  local currentMP = player:getMana()
+  if(currentMP <= loginMP) then
+    player:addMana(loginMP - currentMP)
+  end
 end
 
 function us_onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
It's not an issue, right now script is adding current health/mana only if you have 100% HP/MP. With your chacnge, you can just relogin to heal yourself if you switch items to the one with +HP/MP.
 
if hp > max hp, after setStatsVariant, hp gets set to max hp and each following item just add empty health. I log out with 635 hp, 300 base hp, and items give: belt give 115 hp and armor give 220 hp. When equipment is loaded in order, armor gives var max hp and current hp is 415. 320 hp is lost at login :) This feature can be used to avoid this issue.


note: this may be only because i am using nekiro's distro
 
Did someone else struggle with non-applying the same attributes (helmet +2mlv, armor +4mlvl - counts only one item) from a different items equiped?
 
Did someone else struggle with non-applying the same attributes (helmet +2mlv, armor +4mlvl - counts only one item) from a different items equiped?
If you are using latest version then there shouldn't be such bug happening.
 
Nice release. Is it possible to only use that on some specific items?
 
Can someone convert it to OTServBR - GLobal tfs 1,3 revscript ? I can pay, just pm me. Thanks
 
Back
Top