Giorox
Member
- Joined
- Jun 5, 2009
- Messages
- 19
- Reaction score
- 7
So i'm running a 0.3.6 TFS Global server (8.6) but I am having trouble getting the Skull System to work like global tibia.
What happens is, white skulls are being assigned normally, on attacking/killing an unmarked player, although the server is not assigning a red skull to a player after the alloted kill counts.
Config.lua
creaturescripts.xml
skullcheck.lua
login.lua
EDIT: Just noticed in login.lua he registers a "PlayerKill" event, but that isn't defined anywhere, could it be the culprit?
What happens is, white skulls are being assigned normally, on attacking/killing an unmarked player, although the server is not assigning a red skull to a player after the alloted kill counts.
Config.lua
Lua:
-- Unjustified kills
useFragHandler = true
redSkullLength = 30 * 24 * 60 * 60 * 1000
blackSkullLength = 45 * 24 * 60 * 60 * 1000
dailyFragsToRedSkull = 3
weeklyFragsToRedSkull = 5
monthlyFragsToRedSkull = 10
dailyFragsToBlackSkull = 9
weeklyFragsToBlackSkull = 15
monthlyFragsToBlackSkull = 30
dailyFragsToBanishment = 100
weeklyFragsToBanishment = 300
monthlyFragsToBanishment = 1200
blackSkulledDeathHealth = 40
blackSkulledDeathMana = 0
useBlackSkull = false
advancedFragList = true
-- Banishments
notationsToBan = 3
warningsToFinalBan = 4
warningsToDeletion = 5
banLength = 7 * 24 * 60 * 60
killsBanLength = 7 * 24 * 60 * 60
finalBanLength = 30 * 24 * 60 * 60
ipBanishmentLength = 1 * 24 * 60 * 60
broadcastBanishments = true
maxViolationCommentSize = 200
violationNameReportActionType = 2
autoBanishUnknownBytes = false
-- Battle
worldType = "pvp"
protectionLevel = 20
pvpTileIgnoreLevelAndVocationProtection = true
pzLocked = 60 * 1000
huntingDuration = 60 * 1000
criticalHitChance = 7
criticalHitMultiplier = 1
displayCriticalHitNotify = false
removeWeaponAmmunition = true
removeWeaponCharges = true
removeRuneCharges = true
whiteSkullTime = 15 * 60 * 1000
noDamageToSameLookfeet = false
showHealingDamage = false
showHealingDamageForMonsters = false
fieldOwnershipDuration = 5 * 1000
stopAttackingAtExit = false
loginProtectionPeriod = 10 * 1000
deathLostPercent = 10
stairhopDelay = 1 * 1000
pushCreatureDelay = 2 * 1000
deathContainerId = 1987
gainExperienceColor = 215
addManaSpentInPvPZone = true
squareColor = 0
allowFightback = true
fistBaseAttack = 7
creaturescripts.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="preparedeath" name="Arena" event="script" value="arena.lua"/>
<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
<event type="kill" name="ArenaKill" event="script" value="arenakill.lua"/>
<event type="death" name="PythiusTheRotten" event="script" value="PythiusTheRotten.lua"/>
<event type="death" name="elane" event="script" value="Genesis Quest/elanestorage.lua"/>
<event type="death" name="kirana" event="script" value="Genesis Quest/kiranastorage.lua"/>
<event type="death" name="crunor" event="script" value="Genesis Quest/crunorstorage.lua"/>
<event type="death" name="banor" event="script" value="Genesis Quest/banorstorage.lua"/>
<event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
<!-- Inquisition Full Quest -->
<event type="kill" name="inquisitionPortals" script="Inquisition.lua"/>
<event type="think" name="Idle" event="script" value="idle.lua"/>
<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
</creaturescripts>
skullcheck.lua
Code:
function onThink(cid, interval)
if(not isCreature(cid)) then
return
end
local skull, skullEnd = getCreatureSkull(cid), getPlayerSkullEnd(cid)
if(skullEnd > 0 and skull > SKULL_WHITE and os.time() > skullEnd and not getCreatureCondition(cid, CONDITION_INFIGHT)) then
doPlayerSetSkullEnd(cid, 0, skull)
end
end
login.lua
Lua:
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
accountManager = "Account Manager"
managerCounter = 0
for i, player in ipairs(getOnlinePlayers()) do
if accountManager:lower() == player:lower() then
managerCounter = managerCounter + 1
end
end
if managerCounter >= 3 then
return false
end
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "KillingInTheNameOf")
registerCreatureEvent(cid, "ArenaKill")
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena
return true
end
EDIT: Just noticed in login.lua he registers a "PlayerKill" event, but that isn't defined anywhere, could it be the culprit?
Last edited: