• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Amulet of Loss not working

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,018
Solutions
1
Reaction score
1,040
Location
United States
Sigh, another bug that I can't seem to figure out.
So much issues with the 0.4 TFS.

Anyways, upon death, the amulet of loss does not disappear.
Does anyone know why?

movements.xml:
LUA:
	<movevent type="Equip" itemid="2173" slot="necklace" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="2173" slot="necklace" event="function" value="onDeEquipItem"/>

items.xml:
LUA:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420" />
		<attribute key="slotType" value="necklace" />
		<attribute key="charges" value="1" />
		<attribute key="preventDrop" value="1" />
	</item>

config.lua:
LUA:
	deathLostPercent = 10




Also, please check out this other bug that I have: http://otland.net/f16/issue-quest-rewards-130660/
 
I do have it at open :P.


LUA:
	-- Battle
	-- NOTE: showHealingDamageForMonsters inheritates from showHealingDamage.
	-- loginProtectionPeriod is the famous Tibia anti-magebomb system.
	-- deathLostPercent set to nil enables manual mode.
	worldType = "open"
	protectionLevel = 1
	pvpTileIgnoreLevelAndVocationProtection = true
	pzLocked = 30 * 1000
	huntingDuration = 10 * 1000
	criticalHitChance = 7
	criticalHitMultiplier = 1
	displayCriticalHitNotify = false
	removeWeaponAmmunition = true
	removeWeaponCharges = true
	removeRuneCharges = true
	whiteSkullTime = 7 * 60 * 1000
	noDamageToSameLookfeet = false
	showHealingDamage = true
	showHealingDamageForMonsters = false
	fieldOwnershipDuration = 5 * 1000
	stopAttackingAtExit = false
	loginProtectionPeriod = 10 * 1000
	deathLostPercent = 10
	stairhopDelay = 2 * 1000
	pushCreatureDelay = 2 * 1000
	deathContainerId = 1987
	gainExperienceColor = 215
	addManaSpentInPvPZone = true
	squareColor = 0
	allowFightback = true
	fistBaseAttack = 7
 
Not that I know of, checked through all scripts and I don't see anything related to AOL.
Also, checked creaturescripts.xml and there was only one thing that was related to "death".
Code:
  	<event type="death" name="Azerus" event="script" value="azerus.lua"/>

But I doubt that's the reason, since the death is for determining the death of Azerus.
 
Nope :S

Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
  	<event type="death" name="Azerus" event="script" value="azerus.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="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
</creaturescripts>


azerus.lua
LUA:
local config = {
    message = "Azerus ran into teleporter! It will disappear in 2 minutes. Enter It!",
    teleportId = 1387,
    bosses = { -- Monster Name, Teleport To Position, Teleport Position
        ["Azerus"] = { { x = 956, y = 1020, z = 7 }, { x = 956, y = 1022, z = 7 }},



            }
}


function onDeath(cid, corpse, killer)
    local position = getCreaturePosition(cid)
    for name, pos in pairs(config.bosses) do
        if name == getCreatureName(cid) then

        doCreateTeleport(config.teleportId, pos[1], pos[2])
        doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
        end
    end
    return TRUE
end
 
mmm.
Let's make something so it does disappear.
<event type="death" name="aolremove" event="script" value="aolremove.lua"/>
(register in login.lua too..)

LUA:
local iid = 1111 -- AOL itemid
function onDeath(cid, corpse, killer)
if isPlayer(cid) then
local aol = getPlayerSlotItem(cid, 2)
if aol ~= false then
if aol.itemid == iid then
doRemoveItem(aol.uid)
end
end
end
return true
end
 
Back
Top