Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- local storage = {41902,41402,41202,10216,46412,41603,22372,22375,9000,9002,46414,5151,41113,41112,1240,2009,41103,41101,41102,2009,43331,43332,43333,43334,43330,78431,41503,23047}
- local talents = {4595, 25091, 25092, 25093, 25094}
- function onLogin(cid)
- if (getPlayerStorageValue(cid,24047) == 1) then
- setPlayerStorageValue(cid,24047)
- setGlobalStorageValue(24048,-1)
- end
- if (getPlayerStorageValue(cid,59463) == 1) then
- setPlayerStorageValue(cid,59463)
- setGlobalStorageValue(59955,-1)
- end
- for i = 1,#storage do
- if getPlayerStorageValue(cid, storage[i]) > 0 then
- doPlayerSetStorageValue(cid,storage[i])
- end
- end
- for i = 1,#talents do
- if getPlayerStorageValue(cid, talents[i]) == -1 then
- setPlayerStorageValue(cid, talents[i], 0)
- end
- end
- if isKnight(cid) then
- setCreatureMaxMana(cid, 5*getPlayerLevel(cid))
- setCreatureMaxHealth(cid, 15*getPlayerLevel(cid))
- elseif isPaladin(cid) then
- setCreatureMaxMana(cid, 15*getPlayerLevel(cid))
- setCreatureMaxHealth(cid, 10*getPlayerLevel(cid))
- elseif isSorcerer(cid) then
- setCreatureMaxMana(cid, 30*getPlayerLevel(cid))
- setCreatureMaxHealth(cid, 5*getPlayerLevel(cid))
- elseif isDruid(cid) then
- setCreatureMaxMana(cid, 30*getPlayerLevel(cid))
- setCreatureMaxHealth(cid, 5*getPlayerLevel(cid))
- elseif getPlayerVocation(cid) == 9 then
- setCreatureMaxMana(cid, 5*getPlayerLevel(cid))
- setCreatureMaxHealth(cid, 15*getPlayerLevel(cid))
- end
- doPlayerSetPromotionLevel(cid, 1)
- registerCreatureEvent(cid, "aolDeath")
- registerCreatureEvent(cid, "death")
- registerCreatureEvent(cid, "Monsterlvl")
- registerCreatureEvent(cid, "Walking2")
- registerCreatureEvent(cid, "MarkoMom")
- registerCreatureEvent(cid, "KillLoot")
- registerCreatureEvent(cid, "FakeDead")
- registerCreatureEvent(cid, "Buffs_dead")
- registerCreatureEvent(cid, "Buffs_logout")
- registerCreatureEvent(cid, "Buffs_dmg")
- registerCreatureEvent(cid, "PlayerLogin2")
- registerCreatureEvent(cid, "WeedLogin")
- registerCreatureEvent(cid, "AntiTrashy")
- registerCreatureEvent(cid, "GetToken")
- registerCreatureEvent(cid, "IceBossDeath")
- registerCreatureEvent(cid, "KingDamage")
- registerCreatureEvent(cid, "KingAttack")
- registerCreatureEvent(cid, "KingCorpse")
- registerCreatureEvent(cid, "KingDead")
- registerCreatureEvent(cid, "KingOutfit")
- registerCreatureEvent(cid, "MedalEND")
- registerCreatureEvent(cid, "KingCombat")
- registerCreatureEvent(cid, "Idle")
- registerCreatureEvent(cid, "SpellUp")
- registerCreatureEvent(cid, "RebirthDescription")
- registerCreatureEvent(cid, "PvPTask")
- registerCreatureEvent(cid, "KillStreak")
- registerCreatureEvent(cid, "KillKills")
- registerCreatureEvent(cid, "KillStreakDeath")
- registerCreatureEvent(cid, "MageBomb")
- registerCreatureEvent(cid, "Buffs_login")
- registerCreatureEvent(cid, "Bosslvl")
- registerCreatureEvent(cid, "FireDeath")
- registerCreatureEvent(cid, "BlobDeath")
- registerCreatureEvent(cid, "Crown_Stats")
- registerCreatureEvent(cid, "AntiCheatSystem")
- registerCreatureEvent(cid, "AntiCheatSystem_2")
- registerCreatureEvent(cid, "lastmanDead")
- registerCreatureEvent(cid, "lastmanCorpse")
- registerCreatureEvent(cid, "CTFOutfit")
- registerCreatureEvent(cid, "CTFCombat")
- registerCreatureEvent(cid, "CTFAttack")
- registerCreatureEvent(cid, "CTFCorpse")
- registerCreatureEvent(cid, "CTFDead")
- registerCreatureEvent(cid, "aolDeath")
- registerCreatureEvent(cid, "Bless_Aol")
- registerCreatureEvent(cid, "buffs_combat")
- registerCreatureEvent(cid, "buffs_attack")
- registerCreatureEvent(cid, "Walking")
- registerCreatureEvent(cid, "Survival")
- registerCreatureEvent(cid, "GetTokens")
- 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")
- registerCreatureEvent(cid, "ZombieEvent")
- registerCreatureEvent(cid, "VampireTalent")
- registerCreatureEvent(cid, "TalentPoints")
- registerCreatureEvent(cid, "KillingInTheNameOf")
- registerCreatureEvent(cid, "PetAccept")
- registerCreatureEvent(cid, "KillGiver")
- registerCreatureEvent(cid, "Killexp")
- registerCreatureEvent(cid, "DemoteDeath")
- registerCreatureEvent(cid, "koh_target")
- registerCreatureEvent(cid, "RushOutfit")
- registerCreatureEvent(cid, "MAIL")
- registerCreatureEvent(cid, "RebirthDescription")
- registerCreatureEvent(cid, "GuildMotd")
- registerCreatureEvent(cid, "Idle")
- registerCreatureEvent(cid, "Dead")
- registerCreatureEvent(cid, "GuildWarFrags")
- registerCreatureEvent(cid, "GuildWarBoss")
- registerCreatureEvent(cid, "GuildWarKillPoint")
- registerCreatureEvent(cid, "Deadly")
- registerCreatureEvent(cid, "Behemoth")
- registerCreatureEvent(cid, "FireDeath")
- registerCreatureEvent(cid, "AshDeath")
- registerCreatureEvent(cid, "ZombieAttack")
- registerCreatureEvent(cid, "AdvanceSave")
- registerCreatureEvent(cid, "Bounty")
- registerCreatureEvent(cid, "GuildMotd")
- registerCreatureEvent(cid, "MoveItem")
- registerCreatureEvent(cid, "TalentLook")
- registerCreatureEvent(cid, "TradeAccept")
- registerCreatureEvent(cid, "zombie")
- registerCreatureEvent(cid, "ArenaKill")
- registerCreatureEvent(cid, "YellowDeath")
- registerCreatureEvent(cid, "440KDeath")
- registerCreatureEvent(cid, "460KDeath")
- registerCreatureEvent(cid, "480KDeath")
- registerCreatureEvent(cid, "500KDeath")
- registerCreatureEvent(cid, "600KDeath")
- registerCreatureEvent(cid, "800KDeath")
- registerCreatureEvent(cid, "900KDeath")
- registerCreatureEvent(cid, "1100KDeath")
- registerCreatureEvent(cid, "LizardDeath")
- registerCreatureEvent(cid, "RaperDeath")
- registerCreatureEvent(cid, "GhoulDeath")
- registerCreatureEvent(cid, "FlamingDeath")
- registerCreatureEvent(cid, "AdvanceWeed")
- registerCreatureEvent(cid, "MoveItem2")
- doChangeSpeed(cid, getCreatureBaseSpeed(cid) +1000)
- doCreatureSetNoMove(cid, false)
- if isPlayerGhost(cid) and getPlayerAccess(cid) < 3 then
- doCreatureExecuteTalkAction(cid, "/ghost", true)
- end
- if(config.useFragHandler) then
- registerCreatureEvent(cid, "SkullCheck")
- end
- 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
- if isPlayer(cid) and getPlayerTown(cid) == 1 and isInRange(getThingPos(cid), {x=1000,y=1002,z=6}, {x=1000,y=1002,z=6}) then
- local pos = getThingPos(cid)
- doTeleportThing(cid, {x = pos.x+math.random(-1,1),y=pos.y+math.random(-1,1),z=pos.z})
- end
- 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)
- 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)
- 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
- doCreatureSay(cid, "Welcome!", 20)
- if exhaustion.check(cid,9993) and getPlayerStorageValue(cid, 90232) <= 0 then
- exhaustion.set(cid,9993,1)
- setPlayerStorageValue(cid, 90232, 1)
- end
- if getPlayerStorageValue(cid, 85989) < 0 or getPlayerStorageValue(cid, 85989) == nil then
- setPlayerStorageValue(cid, 85989)
- end
- if exhaustion.check(cid,6760) then
- doPlayerSendTextMessage(cid,MESSAGE_EVENT_ORANGE,""..(exhaustion.check(cid,6760) and ""..math.floor(exhaustion.get(cid,6760) / 86400).." Days Left until 20% exp is out" or "").."")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement