Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.22 KB | None | 0 0
  1. local config = {
  2. loginMessage = getConfigValue('loginMessage'),
  3. useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
  4. }
  5.  
  6. local BUFF = createConditionObject(CONDITION_ATTRIBUTES)
  7. setConditionParam(BUFF, CONDITION_PARAM_TICKS, -1)
  8. setConditionParam(BUFF, CONDITION_PARAM_SUBID, 10)
  9. setConditionParam(BUFF, CONDITION_PARAM_BUFF, 1)
  10. setConditionParam(BUFF, CONDITION_PARAM_STAT_MAXHEALTHPERCENT, 104)
  11. setConditionParam(BUFF, CONDITION_PARAM_STAT_MAXMANAPERCENT, 104)
  12.  
  13. local function removeWeedBuff(cid)
  14. if not isPlayer(cid) then return true end
  15.  
  16. doRemoveCondition(cid, CONDITION_ATTRIBUTES, 10)
  17. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are no longer high.')
  18. end
  19. 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}
  20. local talents = {4595, 25091, 25092, 25093, 25094}
  21.  
  22. function onLogin(cid)
  23. if (getPlayerStorageValue(cid,24047) == 1) then
  24. setPlayerStorageValue(cid,24047)
  25. setGlobalStorageValue(24048,-1)
  26. end
  27.  
  28. if (getPlayerStorageValue(cid,59463) == 1) then
  29. setPlayerStorageValue(cid,59463)
  30. setGlobalStorageValue(59955,-1)
  31. end
  32.  
  33. for i = 1,#storage do
  34. if getPlayerStorageValue(cid, storage[i]) > 0 then
  35. doPlayerSetStorageValue(cid,storage[i])
  36. end
  37. end
  38. for i = 1,#talents do
  39. if getPlayerStorageValue(cid, talents[i]) == -1 then
  40. setPlayerStorageValue(cid, talents[i], 0)
  41. end
  42. end
  43.  
  44.  
  45. if isKnight(cid) then
  46. setCreatureMaxMana(cid, 5*getPlayerLevel(cid))
  47. setCreatureMaxHealth(cid, 15*getPlayerLevel(cid))
  48. elseif isPaladin(cid) then
  49. setCreatureMaxMana(cid, 15*getPlayerLevel(cid))
  50. setCreatureMaxHealth(cid, 10*getPlayerLevel(cid))
  51. elseif isSorcerer(cid) then
  52. setCreatureMaxMana(cid, 30*getPlayerLevel(cid))
  53. setCreatureMaxHealth(cid, 5*getPlayerLevel(cid))
  54. elseif isDruid(cid) then
  55. setCreatureMaxMana(cid, 30*getPlayerLevel(cid))
  56. setCreatureMaxHealth(cid, 5*getPlayerLevel(cid))
  57. elseif getPlayerVocation(cid) == 9 then
  58. setCreatureMaxMana(cid, 5*getPlayerLevel(cid))
  59. setCreatureMaxHealth(cid, 15*getPlayerLevel(cid))
  60. end
  61.  
  62.  
  63. doPlayerSetPromotionLevel(cid, 1)
  64. registerCreatureEvent(cid, "aolDeath")
  65. registerCreatureEvent(cid, "death")
  66. registerCreatureEvent(cid, "Monsterlvl")
  67. registerCreatureEvent(cid, "Walking2")
  68. registerCreatureEvent(cid, "MarkoMom")
  69. registerCreatureEvent(cid, "KillLoot")
  70. registerCreatureEvent(cid, "FakeDead")
  71. registerCreatureEvent(cid, "Buffs_dead")
  72. registerCreatureEvent(cid, "Buffs_logout")
  73. registerCreatureEvent(cid, "Buffs_dmg")
  74. registerCreatureEvent(cid, "PlayerLogin2")
  75. registerCreatureEvent(cid, "WeedLogin")
  76. registerCreatureEvent(cid, "AntiTrashy")
  77. registerCreatureEvent(cid, "GetToken")
  78. registerCreatureEvent(cid, "IceBossDeath")
  79. registerCreatureEvent(cid, "KingDamage")
  80. registerCreatureEvent(cid, "KingAttack")
  81. registerCreatureEvent(cid, "KingCorpse")
  82. registerCreatureEvent(cid, "KingDead")
  83. registerCreatureEvent(cid, "KingOutfit")
  84. registerCreatureEvent(cid, "MedalEND")
  85. registerCreatureEvent(cid, "KingCombat")
  86. registerCreatureEvent(cid, "Idle")
  87. registerCreatureEvent(cid, "SpellUp")
  88. registerCreatureEvent(cid, "RebirthDescription")
  89. registerCreatureEvent(cid, "PvPTask")
  90. registerCreatureEvent(cid, "KillStreak")
  91. registerCreatureEvent(cid, "KillKills")
  92. registerCreatureEvent(cid, "KillStreakDeath")
  93. registerCreatureEvent(cid, "MageBomb")
  94. registerCreatureEvent(cid, "Buffs_login")
  95. registerCreatureEvent(cid, "Bosslvl")
  96. registerCreatureEvent(cid, "FireDeath")
  97. registerCreatureEvent(cid, "BlobDeath")
  98. registerCreatureEvent(cid, "Crown_Stats")
  99. registerCreatureEvent(cid, "AntiCheatSystem")
  100. registerCreatureEvent(cid, "AntiCheatSystem_2")
  101. registerCreatureEvent(cid, "lastmanDead")
  102. registerCreatureEvent(cid, "lastmanCorpse")
  103. registerCreatureEvent(cid, "CTFOutfit")
  104. registerCreatureEvent(cid, "CTFCombat")
  105. registerCreatureEvent(cid, "CTFAttack")
  106. registerCreatureEvent(cid, "CTFCorpse")
  107. registerCreatureEvent(cid, "CTFDead")
  108. registerCreatureEvent(cid, "aolDeath")
  109. registerCreatureEvent(cid, "Bless_Aol")
  110. registerCreatureEvent(cid, "buffs_combat")
  111. registerCreatureEvent(cid, "buffs_attack")
  112. registerCreatureEvent(cid, "Walking")
  113. registerCreatureEvent(cid, "Survival")
  114. registerCreatureEvent(cid, "GetTokens")
  115. registerCreatureEvent(cid, "AdvanceLevel")
  116. registerCreatureEvent(cid, "TURRETCombat")
  117. registerCreatureEvent(cid, "TURRETAttack")
  118. registerCreatureEvent(cid, "TURRETCorpse")
  119. registerCreatureEvent(cid, "TURRETDead")
  120. registerCreatureEvent(cid, "TURRETOutfit")
  121. registerCreatureEvent(cid, "CombatPlant")
  122. registerCreatureEvent(cid, "DeathPlant")
  123. registerCreatureEvent(cid, "DeathPlantSmall")
  124. registerCreatureEvent(cid, "ZombieEvent")
  125. registerCreatureEvent(cid, "VampireTalent")
  126. registerCreatureEvent(cid, "TalentPoints")
  127. registerCreatureEvent(cid, "KillingInTheNameOf")
  128. registerCreatureEvent(cid, "PetAccept")
  129. registerCreatureEvent(cid, "KillGiver")
  130. registerCreatureEvent(cid, "Killexp")
  131. registerCreatureEvent(cid, "DemoteDeath")
  132. registerCreatureEvent(cid, "koh_target")
  133. registerCreatureEvent(cid, "RushOutfit")
  134. registerCreatureEvent(cid, "MAIL")
  135. registerCreatureEvent(cid, "RebirthDescription")
  136. registerCreatureEvent(cid, "GuildMotd")
  137. registerCreatureEvent(cid, "Idle")
  138. registerCreatureEvent(cid, "Dead")
  139. registerCreatureEvent(cid, "GuildWarFrags")
  140. registerCreatureEvent(cid, "GuildWarBoss")
  141. registerCreatureEvent(cid, "GuildWarKillPoint")
  142. registerCreatureEvent(cid, "Deadly")
  143. registerCreatureEvent(cid, "Behemoth")
  144. registerCreatureEvent(cid, "FireDeath")
  145. registerCreatureEvent(cid, "AshDeath")
  146. registerCreatureEvent(cid, "ZombieAttack")
  147. registerCreatureEvent(cid, "AdvanceSave")
  148. registerCreatureEvent(cid, "Bounty")
  149. registerCreatureEvent(cid, "GuildMotd")
  150. registerCreatureEvent(cid, "MoveItem")
  151. registerCreatureEvent(cid, "TalentLook")
  152. registerCreatureEvent(cid, "TradeAccept")
  153. registerCreatureEvent(cid, "zombie")
  154. registerCreatureEvent(cid, "ArenaKill")
  155. registerCreatureEvent(cid, "YellowDeath")
  156. registerCreatureEvent(cid, "440KDeath")
  157. registerCreatureEvent(cid, "460KDeath")
  158. registerCreatureEvent(cid, "480KDeath")
  159. registerCreatureEvent(cid, "500KDeath")
  160. registerCreatureEvent(cid, "600KDeath")
  161. registerCreatureEvent(cid, "800KDeath")
  162. registerCreatureEvent(cid, "900KDeath")
  163. registerCreatureEvent(cid, "1100KDeath")
  164. registerCreatureEvent(cid, "LizardDeath")
  165. registerCreatureEvent(cid, "RaperDeath")
  166. registerCreatureEvent(cid, "GhoulDeath")
  167. registerCreatureEvent(cid, "FlamingDeath")
  168. registerCreatureEvent(cid, "AdvanceWeed")
  169. registerCreatureEvent(cid, "MoveItem2")
  170.  
  171. doChangeSpeed(cid, getCreatureBaseSpeed(cid) +1000)
  172. doCreatureSetNoMove(cid, false)
  173. if isPlayerGhost(cid) and getPlayerAccess(cid) < 3 then
  174. doCreatureExecuteTalkAction(cid, "/ghost", true)
  175. end
  176.  
  177. if(config.useFragHandler) then
  178. registerCreatureEvent(cid, "SkullCheck")
  179. end
  180.  
  181. if getPlayerStorageValue(cid, 8859) > 0 then
  182. local yourRates = getPlayerRates(cid)[SKILL__LEVEL]
  183. local bonusExpRate = 2
  184. local lastTime = exhaustion.check(cid, 3010)
  185. doPlayerSetRate(cid, SKILL__LEVEL, bonusExpRate)
  186. addEvent(bonusExp, lastTime * 1000, cid)
  187. end
  188.  
  189. if isPlayer(cid) and getPlayerTown(cid) == 1 and isInRange(getThingPos(cid), {x=1000,y=1002,z=6}, {x=1000,y=1002,z=6}) then
  190. local pos = getThingPos(cid)
  191. doTeleportThing(cid, {x = pos.x+math.random(-1,1),y=pos.y+math.random(-1,1),z=pos.z})
  192. end
  193.  
  194. if isHigh(cid) then
  195. local duration = getHighDuration(cid)
  196. local pos = getThingPos(cid)
  197. doSendMagicEffect(pos, CONST_ME_STUN)
  198. doSendMagicEffect({x = pos.x + 1, y = pos.y - 1, z = pos.z}, CONST_ME_SMOKE)
  199. doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You are still high.')
  200. doAddCondition(cid, BUFF)
  201. addEvent(removeWeedBuff, duration * 1000, cid)
  202. end
  203.  
  204. if (getCreatureHealth(cid) > getCreatureMaxHealth(cid) ) then
  205. local chuj = -((getCreatureMaxHealth(cid)) - (getCreatureHealth(cid)))
  206. local chuje = -((getCreatureMaxMana(cid)) - (getCreatureMana(cid)))
  207. doCreatureAddHealth(cid, chuj)
  208. doCreatureAddMana(cid, chuje)
  209. end
  210.  
  211. if (getCreatureStorage(cid, 88953) > 0) then
  212. setCreatureMaxHealth(cid, 185)
  213. setCreatureMaxMana(cid, 35)
  214. doCreatureAddMana(cid, 35)
  215. doCreatureAddHealth(cid, 185)
  216. setPlayerStorageValue(cid, 88953)
  217. end
  218.  
  219. local accountManager = getPlayerAccountManager(cid)
  220. if(accountManager == MANAGER_NONE) then
  221. local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
  222. if(lastLogin > 0) then
  223. doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  224. else
  225. doPlayerSendOutfitWindow(cid)
  226. doTeleportThing(cid, {x=851, y=895, z=4})
  227. end
  228. doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  229. elseif(accountManager == MANAGER_NAMELOCK) then
  230. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
  231. elseif(accountManager == MANAGER_ACCOUNT) then
  232. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to START over then type 'cancel'.")
  233. else
  234. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
  235. end
  236.  
  237. if(not isPlayerGhost(cid)) then
  238. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
  239. end
  240.  
  241. doCreatureSay(cid, "Welcome!", 20)
  242. if exhaustion.check(cid,9993) and getPlayerStorageValue(cid, 90232) <= 0 then
  243. exhaustion.set(cid,9993,1)
  244. setPlayerStorageValue(cid, 90232, 1)
  245. end
  246.  
  247. if getPlayerStorageValue(cid, 85989) < 0 or getPlayerStorageValue(cid, 85989) == nil then
  248. setPlayerStorageValue(cid, 85989)
  249. end
  250.  
  251. if exhaustion.check(cid,6760) then
  252. 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 "").."")
  253. end
  254.  
  255. return true
  256. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement