local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
local BUFF = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(BUFF, CONDITION_PARAM_TICKS, -1)
setConditionParam(BUFF, CONDITION_PARAM_SUBID, 10)
setConditionParam(BUFF, CONDITION_PARAM_BUFF, 1)
setConditionParam(BUFF, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 104)
setConditionParam(BUFF, CONDITION_PARAM_STAT_MAXMANAPERCENT, 104)
local function removeWeedBuff(cid)
if not isPlayer(cid) then return true end
doRemoveCondition(cid, CONDITION_ATTRIBUTES, 10)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are no longer high.')
end
function onLogin(cid)
registerCreatureEvent(cid, "RS_BS_Bless")
if getPlayerStorageValue(cid, 1) == 1 then
-- reset damage increase by 10 as defined in the kill script
setPlayerStorageValue(cid, 4523, getPlayerStorageValue(cid, 4523) - 10)
setPlayerStorageValue(cid, 1, -1)
end
if getPlayerPromotionLevel(cid) < 1 then
doPlayerSetPromotionLevel(cid, 1)
end
setPlayerStorageValue(cid, 22372, -1)
setPlayerStorageValue(cid, 22375, -1)
registerCreatureEvent(cid, "lmsKill")
registerCreatureEvent(cid, "Buffs_dead")
registerCreatureEvent(cid, "Buffs_logout")
registerCreatureEvent(cid, "Buffs_dmg")
registerCreatureEvent(cid, "outfitboss")
registerCreatureEvent(cid, "Buffs_login")
registerCreatureEvent(cid, "statschange")
registerCreatureEvent(cid, "PtToken")
registerCreatureEvent(cid, "killexp")
registerCreatureEvent(cid, "FireDeath")
registerCreatureEvent(cid, "VipCheck")
registerCreatureEvent(cid, "Crown_Stats")
registerCreatureEvent(cid, "AntiCheatSystem")
registerCreatureEvent(cid, "AntiCheatSystem_2")
registerCreatureEvent(cid, "Pushing")
registerCreatureEvent(cid, "firstitems")
registerCreatureEvent(cid, "TalentPoints")
registerCreatureEvent(cid, "lastmanDead")
registerCreatureEvent(cid, "lastmanCorpse")
registerCreatureEvent(cid, "CTFOutfit")
registerCreatureEvent(cid, "CTFCombat")
registerCreatureEvent(cid, "CTFAttck")
registerCreatureEvent(cid, "CTFCorpse")
registerCreatureEvent(cid, "CTFDead")
registerCreatureEvent(cid, "AntiTrash")
registerCreatureEvent(cid, "testkill")
registerCreatureEvent(cid,'KillKills')
registerCreatureEvent(cid,'KillStreak')
registerCreatureEvent(cid,'KillStreakDeath')
registerCreatureEvent(cid, "KingCombat")
registerCreatureEvent(cid, "KingAttack")
registerCreatureEvent(cid, "KingDamage")
registerCreatureEvent(cid, "KingCorpse")
registerCreatureEvent(cid, "KingDead")
registerCreatureEvent(cid, "KingOutfit")
registerCreatureEvent(cid, "CreateTeleport")
registerCreatureEvent(cid, "CreateTeleport1")
registerCreatureEvent(cid, "CreateTeleport2")
registerCreatureEvent(cid, "CreateTeleport3")
registerCreatureEvent(cid, "Bless_Aol")
registerCreatureEvent(cid, "buffs_combat")
registerCreatureEvent(cid, "buffs_attack")
registerCreatureEvent(cid, "HornedDeath")
registerCreatureEvent(cid, "WeedLogin")
registerCreatureEvent(cid, "Survival")
registerCreatureEvent(cid, "AdvanceLevel")
registerCreatureEvent(cid, "TURRETCombat")
registerCreatureEvent(cid, "TURRETAttack")
registerCreatureEvent(cid, "TURRETCorpse")
registerCreatureEvent(cid, "TURRETDead")
registerCreatureEvent(cid, "TURRETOutfit")
registerCreatureEvent(cid, "CombatPlant")
registerCreatureEvent(cid, "DeathPlant")
registerCreatureEvent(cid, "DeathPlantSmall")
setPlayerStorageValue(cid, 43331, -1)
setPlayerStorageValue(cid, 43332, -1)
setPlayerStorageValue(cid, 43333, -1)
setPlayerStorageValue(cid, 43334, -1)
setPlayerStorageValue(cid, 43330, -1)
doChangeSpeed(cid, getCreatureBaseSpeed(cid))
doCreatureSetNoMove(cid, false)
if getPlayerStorageValue(cid, 8859) > 0 then
local yourRates = getPlayerRates(cid)[SKILL__LEVEL]
local bonusExpRate = 2
local lastTime = exhaustion.check(cid, 3010)
doPlayerSetRate(cid, SKILL__LEVEL, bonusExpRate)
addEvent(bonusExp, lastTime * 1000, cid)
end
registerCreatureEvent(cid, "AdvanceWeed")
if isHigh(cid) then
local duration = getHighDuration(cid)
local pos = getThingPos(cid)
doSendMagicEffect(pos, CONST_ME_STUN)
doSendMagicEffect({x = pos.x + 1, y = pos.y - 1, z = pos.z}, CONST_ME_SMOKE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are still high.')
doAddCondition(cid, BUFF)
addEvent(removeWeedBuff, duration * 1000, cid)
end
if (getCreatureHealth(cid) > getCreatureMaxHealth(cid) ) then
local chuj = -((getCreatureMaxHealth(cid)) - (getCreatureHealth(cid)))
local chuje = -((getCreatureMaxMana(cid)) - (getCreatureMana(cid)))
doCreatureAddHealth(cid, chuj)
doCreatureAddMana(cid, chuje)
end
if (getCreatureStorage(cid, 88953) > 0) then
setCreatureMaxHealth(cid, 185)
setCreatureMaxMana(cid, 35)
doCreatureAddMana(cid, 35)
doCreatureAddHealth(cid, 185)
setPlayerStorageValue(cid, 88953, 0)
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
doPlayerSendOutfitWindow(cid)
doTeleportThing(cid, {x=851, y=895, z=4})
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, "ZombieEvent")
registerCreatureEvent(cid, "TalentLook")
registerCreatureEvent(cid, "KillingInTheNameOf")
registerCreatureEvent(cid, "PetAccept")
registerCreatureEvent(cid, "KillGiver")
registerCreatureEvent(cid, "DemoteDeath")
registerCreatureEvent(cid, "koh_target")
registerCreatureEvent(cid, "RushOutfit")
registerCreatureEvent(cid, "GetToken")
registerCreatureEvent(cid, "MAIL")
registerCreatureEvent(cid, "RebirthDescription")
registerCreatureEvent(cid, "SlotLogin")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "Monsterlvl")
registerCreatureEvent(cid, "Monsterearn")
registerCreatureEvent(cid, "Sonsterlvl")
registerCreatureEvent(cid, "spellodmg")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "teleportpaper")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "addDesc")
registerCreatureEvent(cid, "death2")
registerCreatureEvent(cid, "death")
registerCreatureEvent(cid, "KOHEventS")
registerCreatureEvent(cid, "Deadly")
registerCreatureEvent(cid, "FireDeath")
registerCreatureEvent(cid, "VampiroDeath")
registerCreatureEvent(cid, "WarriorDeath")
registerCreatureEvent(cid, "HerodoDeath")
registerCreatureEvent(cid, "GoluromDeath")
registerCreatureEvent(cid, "BeholderDeath")
registerCreatureEvent(cid, "SkeletoniroDeath")
registerCreatureEvent(cid, "PriestessDeath")
registerCreatureEvent(cid, "KakoDeath")
registerCreatureEvent(cid, "FighterDeath")
registerCreatureEvent(cid, "KermitDeath")
registerCreatureEvent(cid, "CavemanDeath")
registerCreatureEvent(cid, "DragonyDeath")
registerCreatureEvent(cid, "SeptunDeath")
registerCreatureEvent(cid, "KargasDeath")
registerCreatureEvent(cid, "MayoDeath")
registerCreatureEvent(cid, "DrakonDeath")
registerCreatureEvent(cid, "YellowDeath")
registerCreatureEvent(cid, "BaterinoDeath")
registerCreatureEvent(cid, "TarantuloDeath")
registerCreatureEvent(cid, "AshDeath")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "Bounty")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "TBEventC")
registerCreatureEvent(cid, "TBEventS")
registerCreatureEvent(cid, "TBEventO")
registerCreatureEvent(cid, "zombie")
registerCreatureEvent(cid, "ArenaKill")
registerCreatureEvent(cid, "Arabic Pharao")
registerCreatureEvent(cid, "ZLMSEvent")
-- if he did not make full arena 1 he must START from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must START from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
if getPlayerStorageValue(cid, 85989) < 0 or getPlayerStorageValue(cid, 85989) == nil then
setPlayerStorageValue(cid, 85989, 0)
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena
doCreatureSay(cid, "Welcome!", 20)
return true
end