Hello,
Im currently working on a questline where there will be 3 missions that the player is asked to kill a boss on each mission.
I need help to get the Storage value updated after the boss been slain.
The scripts that im running
Creaturescripts/scripts/custom
I dont get it to work, so i cannot return the quest after the boss is killed.
Anyone has any ideas why? Scripts that i used is found here on otLand. but im Using TFS 1.5 and i think they are for some earlier versions
Im currently working on a questline where there will be 3 missions that the player is asked to kill a boss on each mission.
I need help to get the Storage value updated after the boss been slain.
The scripts that im running
Creaturescripts/scripts/custom
Creaturescripts.xmlfunction onKill(cid, target, damage, flags)
local bossName = "Bossname"
if isMonster(target) and getCreatureName(target) == bossName and bit.band(flags, 1) == 1 then
local player = Player(cid)
if player then
if player:getStorageValue(Storage.Quest.Bossname) ~= 2 then
-- Update the storage value to 2 when boss is killed
player:setStorageValue(Storage.Quest.Bossname, 2)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have defeated XXXXXX.")
end
if player:getStorageValue(Storage.Quest.BossName) ~= 3 then
player:setStorageValue(Storage.Quest.Bossname, 3)
player:setStorageValue(Storage.Quest.PlaceX, 1) -- Grant access to PlaceX
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have slain the boss and got access to PlaceX.")
end
end
end
return true
end
Login.lua<event type="kill" name="BossName" event="script" value="custom/bossName.lua"/>
registerCreatureEvent(cid, "bossName")
I dont get it to work, so i cannot return the quest after the boss is killed.
Anyone has any ideas why? Scripts that i used is found here on otLand. but im Using TFS 1.5 and i think they are for some earlier versions
Last edited: