kilirt
New Member
- Joined
- May 11, 2009
- Messages
- 223
- Reaction score
- 2
hello, i come here because i've a problem with my script, my creaturescript. i hate them
normaly when i kill a boss it must said a message and other but nothing happen and no error in console, i hope you can help me
boss.lua
login.lua:
creaturescript.xml:
normaly when i kill a boss it must said a message and other but nothing happen and no error in console, i hope you can help me
boss.lua
Lua:
local config = {
respawnSecs = 20, -- how many seconds until next boss spawns
storage = 70200,
bosspos = {x=17168,y=16606,z=8},
bossspawnstorage = 70300
}
local t = {'Morgaroth','Ghazbaran','Ferumbras','Orshabaal','Countess Sorrow','Massacre','Fluffy','Dracola','the plasmother','Mr. Punish','The Handmaiden'}
local function f()
doCreateMonster(t[math.random(#t)], config.bosspos, false, true, true)
doBroadcastMessage('A new boss has spawned in the boss arena!', MESSAGE_STATUS_CONSOLE_ORANGE)
doSetStorage(config.bossspawnstorage, 0)
end
function onKill(cid, target, damage, flags)
if bit.band(flags, 1) == 1 and isMonster(target) and getCreatureMaster(target) == target and getPlayerStorageValue(cid,config.storage) == 1 then
local s = getCreatureName(target)
if isInArray(t, s:lower()) and getStorage(config.bossspawnstorage) == 0 then
doBroadcastMessage(getCreatureName(cid)..' has just killed the boss "'..s..'", a new boss will spawn in '..config.respawnSecs..' seconds!', MESSAGE_STATUS_CONSOLE_ORANGE)
doSetStorage(config.bossspawnstorage,1)
addEvent(f, config.respawnSecs*1000)
end
end
return true
end
login.lua:
Lua:
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
local a = 0
local limitAM = 20
if getCreatureName(cid):lower() == "account manager" then
for _, pid in ipairs(getPlayersOnline()) do
if getCreatureName(pid):lower() == "account manager" and pid ~= cid then
a = a + 1
end
end
if a >= limitAM then
return false
end
return true
end
if (getCreatureName(cid) == "Account Manager") then
return doRemoveCreature(cid, true)
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, "VipCheck")
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "BossKill")
registerCreatureEvent(cid, "BossKillvip")
-- registerCreatureEvent(cid, "pacmanhandle")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "fatality")
return true
end
creaturescript.xml:
XML:
<event type="kill" name="BossKill" event="script" value="bosskill.lua"/>