Cloow
Active Member
- Joined
- May 10, 2010
- Messages
- 1,086
- Reaction score
- 35
Hello,
So I've spent the whole day and the day before that and perhaps the day even before that trying to make a inq teleport script, mostly because i'm trying to learn myself how to script.
I know theres a few posts already about this subject but I couldn't find one that I was looking that gives storage for all those that participated in the fight, so I have taken abit of code from each and everyone and wrote some myself..
But now i'm so tired of this script and really want to move on to something else and im stuck because its not working and it does not give me any errors either so I dont know what to do..
help is greatly appreciated
So here it comes:
creaturescripts.xml
creaturescripts/scripts/login.lua
creaturescripts/scripts/inq/ushuriel.lua
So I've spent the whole day and the day before that and perhaps the day even before that trying to make a inq teleport script, mostly because i'm trying to learn myself how to script.
I know theres a few posts already about this subject but I couldn't find one that I was looking that gives storage for all those that participated in the fight, so I have taken abit of code from each and everyone and wrote some myself..
But now i'm so tired of this script and really want to move on to something else and im stuck because its not working and it does not give me any errors either so I dont know what to do..
help is greatly appreciated
So here it comes:
creaturescripts.xml
XML:
<event type="kill" name="InqBoss" script="inq/ushuriel.lua" />
creaturescripts/scripts/login.lua
Lua:
player:registerEvent("InqBoss")
creaturescripts/scripts/inq/ushuriel.lua
Lua:
local config = {
{boss = {'ushuriel'}, storage = 8000, pos = Position(1260, 1504, 12), destination = Position(1308, 1576, 12)},
{boss = {'zugurosh'}, storage = 8001, pos = Position(1263, 1542, 12), destination = Position(1234, 1576, 12)}
}
local function removeTeleport(position)
local teleportItem = Tile(position):getItemById(1387)
if teleportItem then
teleportItem:remove()
position:sendMagicEffect(CONST_ME_POFF)
end
end
function onKill(cid, target, damage, flags, corpse)
if(isMonster(target)) then
if(string.lower(getCreatureName(target)) == config.boss) then
for attackerUid, damage in pairs(target:getDamageMap()) do
local player = Player(attackerUid)
if player and player:getStorageValue(config.storage) < 1 then
player:setStorageValue(config.storage, 1)
end
end
local position = target:getPosition()
position:sendMagicEffect(CONST_ME_TELEPORT)
local item = Game.createItem(1387, 1, config.pos)
if item:isTeleport() then
item:setDestination(config.destination)
end
target:say('Congratulations on killing You have 3 minutes to enter the Crystal Caves.', TALKTYPE_MONSTER_SAY, 0, 0, position)
addEvent(removeTeleport, 3 * 60 * 1000, config.pos)
return true
end
end
end