mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 06:34:55 +02:00
Resolve "Merge the best from 7.40 branch"
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
function onSay(player, words, param)
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "Buying a house is available only through auction which is available at website: https://sabrehaven.com/house.php")
|
||||
player:sendTextMessage(MESSAGE_INFO_DESCR, "Buying a house is available only through auction which is available at website: https://tibianus.com/house.php")
|
||||
return false
|
||||
end
|
||||
|
20
data/talkactions/scripts/impersonate.lua
Normal file
20
data/talkactions/scripts/impersonate.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
function onSay(player, words, param)
|
||||
if not player:getGroup():getAccess() then
|
||||
return true
|
||||
end
|
||||
|
||||
local split = param:split(",")
|
||||
local target = Player(split[1])
|
||||
if target == nil then
|
||||
player:sendCancelMessage("Player not found.")
|
||||
return false
|
||||
end
|
||||
|
||||
if target:getGroup():getAccess() then
|
||||
player:sendCancelMessage("You cannot impersonate this player.")
|
||||
return false
|
||||
end
|
||||
|
||||
target:say(split[2], TALKTYPE_SAY)
|
||||
return false
|
||||
end
|
@@ -1,6 +1,14 @@
|
||||
local maxPlayersPerMessage = 10
|
||||
|
||||
function onSay(player, words, param)
|
||||
if not player:getGroup():getAccess() then
|
||||
return true
|
||||
end
|
||||
|
||||
if player:getAccountType() < ACCOUNT_TYPE_GOD then
|
||||
return false
|
||||
end
|
||||
|
||||
local hasAccess = player:getGroup():getAccess()
|
||||
local players = Game.getPlayers()
|
||||
local onlineList = {}
|
||||
|
@@ -92,7 +92,6 @@ end
|
||||
local function getDefense(creature, random1, random2)
|
||||
local totalDefense = creature:getType():getDefense() + 1
|
||||
local defenseSkill = creature:getType():getSkill()
|
||||
|
||||
local formula = math.floor((5 * (defenseSkill) + 50) * totalDefense)
|
||||
local randresult = math.floor(random1 % 100)
|
||||
|
||||
@@ -112,13 +111,15 @@ local function getArmor(creature, rand)
|
||||
return armor
|
||||
end
|
||||
|
||||
local function setPhysicalDamageBlock(creature, damage, random1, random2, randomArmor)
|
||||
local function setPhysicalDamageBlock(creature, isCloseRange, damage, random1, random2, randomArmor)
|
||||
if bit.band(creature:getType():getCombatImmunities(), COMBAT_PHYSICALDAMAGE) == COMBAT_PHYSICALDAMAGE then
|
||||
return 0
|
||||
end
|
||||
|
||||
damage = damage + getDefense(creature, random1, random2)
|
||||
|
||||
|
||||
if isCloseRange then
|
||||
damage = damage + getDefense(creature, random1, random2)
|
||||
end
|
||||
|
||||
if damage >= 0 then
|
||||
return 0
|
||||
end
|
||||
@@ -134,7 +135,7 @@ local function setPhysicalDamageBlock(creature, damage, random1, random2, random
|
||||
end
|
||||
|
||||
local function isThrowableHit(weapon, ammunition, skillValue, rand)
|
||||
local distance = 15 -- we consider distance is always the best
|
||||
local distance = 75 -- we consider distance is always the best
|
||||
local hitChance = 75 -- throwables and such
|
||||
|
||||
if weapon:getAmmoType() ~= 0 then
|
||||
@@ -158,20 +159,20 @@ local function getTotalDamage(creature, weapon, ammunition, vocation, attack, sk
|
||||
|
||||
if weapon ~= nil and weapon:getWeaponType() == WEAPON_DISTANCE then
|
||||
if isThrowableHit(weapon, ammunition, skillValue, os.rand()) then
|
||||
damage = setPhysicalDamageBlock(creature, damage, os.rand(), os.rand(), os.rand())
|
||||
damage = setPhysicalDamageBlock(creature, false, damage, os.rand(), os.rand(), os.rand())
|
||||
else
|
||||
damage = 0
|
||||
end
|
||||
minDamage = 0
|
||||
if isThrowableHit(weapon, ammunition, skillValue, 0) then
|
||||
maxDamage = setPhysicalDamageBlock(creature, maxDamage, 0, 0, 0)
|
||||
maxDamage = setPhysicalDamageBlock(creature, false, maxDamage, 0, 0, 0)
|
||||
else
|
||||
maxDamage = 0
|
||||
end
|
||||
else
|
||||
damage = setPhysicalDamageBlock(creature, damage, os.rand(), os.rand(), os.rand())
|
||||
minDamage = setPhysicalDamageBlock(creature, minDamage, 99, 99, rshift(creature:getType():getArmor(), 1) + 1)
|
||||
maxDamage = setPhysicalDamageBlock(creature, maxDamage, 0, 0, 0)
|
||||
damage = setPhysicalDamageBlock(creature, true, damage, os.rand(), os.rand(), os.rand())
|
||||
minDamage = setPhysicalDamageBlock(creature, true, minDamage, 99, 99, rshift(creature:getType():getArmor(), 1) + 1)
|
||||
maxDamage = setPhysicalDamageBlock(creature, true, maxDamage, 0, 0, 0)
|
||||
end
|
||||
|
||||
local container = {}
|
||||
@@ -235,7 +236,12 @@ function onSay(player, words, param)
|
||||
local skillValue = player:getSkillLevel(skillType)
|
||||
if skillValueNumber ~= nil then
|
||||
if tonumber(skillValueNumber) > 0 then
|
||||
skillValue = tonumber(skillValueNumber)
|
||||
if tonumber(skillValueNumber) <= 300 then
|
||||
skillValue = tonumber(skillValueNumber)
|
||||
else
|
||||
player:sendCancelMessage("The skill value has to be no bigger than 300.")
|
||||
return false
|
||||
end
|
||||
else
|
||||
player:sendCancelMessage("The skill value has to be a number and greater than zero.")
|
||||
return false
|
||||
|
@@ -96,7 +96,7 @@ function wave2()
|
||||
end
|
||||
|
||||
function wave3()
|
||||
broadcastMessage("Ankrahmun: All Sabrehaven PEOPLE. THIS IS NOT A PRACTICE. Leave our city NOW!", MESSAGE_STATUS_WARNING)
|
||||
broadcastMessage("Ankrahmun: All Tibianus PEOPLE. THIS IS NOT A PRACTICE. Leave our city NOW!", MESSAGE_STATUS_WARNING)
|
||||
earthquakeTower(area.fromPos, area.toPos)
|
||||
end
|
||||
|
||||
|
10
data/talkactions/scripts/vial.lua
Normal file
10
data/talkactions/scripts/vial.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
function onSay(player, words, param)
|
||||
if player:getStorageValue(17742) ~= 1 then
|
||||
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Vials auto removing enabled.")
|
||||
player:setStorageValue(17742, 1)
|
||||
else
|
||||
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Vials auto removing disabled.")
|
||||
player:setStorageValue(17742, 0)
|
||||
end
|
||||
return false
|
||||
end
|
Reference in New Issue
Block a user