Animera
* * * * *
everything is fixed atm.
Last edited:
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
local town = "Enigma" --- town name
local townid = 1 --- put the town id
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
if getPlayerStorageValue(cid, storage) == FALSE then
doPlayerSendTextMessage(cid,24,"You have no vip, Purchace VIP to get acces to nice places and unique features!")
doPlayerSetTown(cid, townid)
end
registerCreatureEvent(cid, "PlayerDeath")
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
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, "MonsterPortal")
registerCreatureEvent(cid, "MonsterPortal2")
registerCreatureEvent(cid, "MonsterPortal3")
registerCreatureEvent(cid, "MonsterPortal4")
registerCreatureEvent(cid, "RewardGhastly")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Advanceeffect")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end
function onKill(cid, target)
setPlayerStorageValue(cid,45459,1)
doPlayerSay(cid, 'Congratulations! You slaughted The Haunted dragon, Get your rewards in the room in the west.', 19)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE, cid)
return true
end
12:56 Hello, type 'account' to create an account or type 'recover' to recover an account.
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
local town = "Enigma" --- town name
local townid = 1 --- put the town id
function onLogin(cid)
if getPlayerStorageValue(cid, storage) == FALSE then
doPlayerSendTextMessage(cid,24,"You have no vip, Purchace VIP to get acces to nice places and unique features!")
doPlayerSetTown(cid, townid)
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, "PlayerDeath")
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "MonsterPortal")
registerCreatureEvent(cid, "MonsterPortal2")
registerCreatureEvent(cid, "MonsterPortal3")
registerCreatureEvent(cid, "MonsterPortal4")
registerCreatureEvent(cid, "RewardGhastly")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Advanceeffect")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
function pick_quest(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local level = getPlayerLevel(cid)
for k, v in pairs(wow_like_quests) do
local required = tonumber(k)
if(level >= required) then
for i, v in ipairs(v) do
if getPlayerLevel(cid) >= 80 then
setPlayerStorageValue(cid,66226,1)
npcHandler:say("Our city keep getting earthquakes please help us go to the larva cave and find out who is responsible for this and kill him!", cid)
parameters.quest = v
return true
end
npcHandler:resetNpc()
return true
end
end
end
end
npcHandler:say("I have no quests to offer you at the moment. Come back when your stronger", cid)
npcHandler:resetNpc()
function accept_quest(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local quest = node:getParent():getParameters().quest
local storage = quest.storage
setPlayerStorageValue(cid, storage, 0)
npcHandler:say("I'm expecting to hear from you again. Don't dissapoint me.", cid)
if(quest.on_accept) then quest.on_accept(cid, quest) end
npcHandler:resetNpc()
return true
end
-- Keyword "Quest" will pick lowest undone quest for you.
local questNode = keywordHandler:addKeyword({'quest'}, pick_quest, {})
questNode:addChildKeyword({'yes'}, accept_quest, {})
questNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too hard for you, eh?'})
npcHandler:addModule(FocusModule:new())
function onKill(cid, target, lastHit)
if isPlayer(cid) and getCreatureName(target):lower() == 'the haunted dragon' then
doCreatureSetStorage(cid, 45459, 1)
doCreatureSay(cid, 'Congratulations! You slaughted The Haunted dragon, Get your rewards in the room in the west.', 19)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end
return true
end
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
local VIPstorage = 13243
local town = "Enigma" --- town name
local townid = 1 --- put the town id
function onLogin(cid)
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 getPlayerStorageValue(cid, VIPstorage) == -1 then
doPlayerSendTextMessage(cid,24,"You have no vip, Purchace VIP to get acces to nice places and unique features!")
doPlayerSetTown(cid, townid)
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "MonsterPortal")
registerCreatureEvent(cid, "MonsterPortal2")
registerCreatureEvent(cid, "MonsterPortal3")
registerCreatureEvent(cid, "MonsterPortal4")
registerCreatureEvent(cid, "RewardGhastly")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Advanceeffect")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end
local config =
{
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
local town = "Enigma" --- town name
local townid = 1 --- put the town id
function onLogin(cid)
-- what this for (?)
if (getPlayerStorageValue(cid, sotrage) ~= 1) then
doPlayerSendTextMessage(cid, 24, "You have no vip, Purchace VIP to get acces to nice places and unique features!")
doPlayerSetTown(cid, townid)
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, "PlayerDeath")
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "MonsterPortal")
registerCreatureEvent(cid, "MonsterPortal2")
registerCreatureEvent(cid, "MonsterPortal3")
registerCreatureEvent(cid, "MonsterPortal4")
registerCreatureEvent(cid, "RewardGhastly")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Advanceeffect")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end