Guest User

Untitled

a guest
Sep 23rd, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 101.24 KB | None | 0 0
  1. Global FactionPowers, TreasureList, CharList, LastPhoto, PhotoName, PhotoList, TodaysMonth, TimeOutGo
  2. Global gDispatcher, LegitUsers, CDKeys
  3. global gWeather
  4. global gMuted
  5. global gGlobalMute
  6. global gPacketCounts
  7. global GameMasters, ColiseumFlag, CTFFlag, CurrentCarriers, Arena
  8.  
  9.  
  10. on IncomingMessage(me, movie, group, user, fullMsg)
  11.  
  12. username = user.name
  13. content = fullmsg.content
  14.  
  15. -- Compares packet counts with client and server.
  16. if (ilk(content) = #list) then
  17. clientCounts = content[1]
  18. serverCounts = gPacketCounts.getProp(username)
  19. gPacketCounts.setProp(username, serverCounts + 1)
  20. if not(gPacketCounts.getProp(username) = clientCounts) then
  21. sendPacket("system.user.delete", empty, username)
  22. exit
  23. end if
  24. else
  25. sendPacket("system.user.delete", empty, username)
  26. exit
  27. end if
  28.  
  29. fullmsg.content = content[2]
  30. content = fullmsg.content
  31.  
  32. if (content contains "..\") then sendPacket("system.user.delete", empty, username)
  33. if (content contains "../") then sendPacket("system.user.delete", empty, username)
  34.  
  35.  
  36. if string(username) <> string(fullmsg.SenderID) then
  37. User.sendMessage("DieScum", "byebye", 0, FALSE, username)
  38. exit
  39. end if
  40.  
  41. case fullMsg.subject of
  42.  
  43.  
  44.  
  45. "DeathMessage":
  46.  
  47.  
  48. if (CTFFlag = 1) then
  49. CTFJoinList = fread("DAT\CTF\Joinlist.txt", #text)
  50. the itemdelimiter = ":"
  51. repeat with x = 2 to CTFJoinList.item[1]
  52. if (CTFJoinList.item[x] = Username) then
  53. sendpacket("@CTF", "DeathTxt", "*** " & Username & " was just killed in CTF by " & content & ".")
  54. exit
  55. end if
  56. end repeat
  57. end if
  58.  
  59.  
  60. if (ColiseumFlag = 1) then
  61. ColiJoinList = fread("DAT\Coliseum\Joinlist.txt", #text)
  62. the itemdelimiter = ":"
  63. repeat with x = 2 to ColiJoinList.item[1]
  64. if (ColiJoinList.item[1] = Username) then
  65. sendpacket("@Coliseum", "DeathTxt", "*** " & Username & " was just killed in the Coliseum by " & content & ".")
  66. exit
  67. end if
  68. end repeat
  69. end if
  70.  
  71.  
  72. sendpacket("@allusers", "deathtxt", "*** " & Username & " was just killed by " & content & ".")
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. "Verify Client":
  80. clientHash = fread("Database\Settings\Client Hash.txt", #text)
  81. if (not(clientHash = content)) then sendPacket(username, "Outdated Client", void)
  82.  
  83. "Character Manager Load":
  84. if (not(getUserRank(username) = "Game Master")) then exit
  85. if not(file("Database\Characters\" & content & ".txt").exists) then
  86. sendPacket(username, "Alert", "A character with that username does not exist.")
  87. exit
  88. end if
  89. charFile = fread("Database\Characters\" & content & ".txt", #text)
  90. itemsFile = fread("Database\Characters\" & content & "-i.txt", #text)
  91. respawnPoint = fread("DAT\DM\" & content & ".txt", #text)
  92. bankFile = fread("DAT\Bank\" & content & ".txt", #text)
  93. reputation = fread("Database\Characters\" & content & "-r.txt", #text)
  94. PKs = fread("Database\Characters\" & content & "-PKs.txt", #text)
  95. Deaths = fread("Database\Characters\" & content & "-PDs.txt", #text)
  96. data = [charFile, itemsFile, respawnPoint, bankFile, reputation, PKs, Deaths]
  97. sendPacket(username, "Character Manager Loaded", data)
  98. sendPacket(content, "Broadcast 242", "Your character is currently being viewed by a staff member. Please refrain from being involved in any serious gameplay as modifications to your character may take place. This will ensure no loss of levels or items. You will be notified when all modifications have been completed.")
  99.  
  100. "Character Manager Save":
  101. if (not(getUserRank(username) = "Game Master")) then exit
  102. sendPacket(content[1], "Alert", "Your character has been modified by a staff member." & return & "These changes won't take place until you reconnect to the server.")
  103. sendPacket("system.user.delete", empty, content[1])
  104. fwrite("Database\Characters\" & content[1] & ".txt", content[2], #text)
  105. fwrite("Database\Characters\" & content[1] & "-i.txt", content[3], #text)
  106. fwrite("DAT\DM\" & content[1] & ".txt", content[4], #text)
  107. fwrite("DAT\Bank\" & content[1] & ".txt", content[5], #text)
  108. fwrite("Database\Characters\" & content[1] & "-r.txt", content[6], #text)
  109. fwrite("Database\Characters\" & content & "-PKs.txt", content[7], #text)
  110. fwrite("Database\Characters\" & content & "-PDs.txt", content[8], #text)
  111.  
  112. "Character Manager Cancel":
  113. if (not(getUserRank(username) = "Game Master")) then exit
  114. sendPacket(content, "Broadcast 242", "Your character is no longer being viewed by a staff member and no modifications were made. You may now continue normal gameplay.")
  115.  
  116. "Mob/NPC Manager Load":
  117. allowedRanks = ["Game Master", "Economist"]
  118. allowed = false
  119. repeat with i = 1 to allowedRanks.count
  120. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  121. end repeat
  122. if (not(allowed)) then exit
  123. name = content
  124. if not(file("DAT\NPC\" & name & ".txt").exists) then
  125. sendPacket(username, "Alert", "A Mob/NPC with that name does not exist.")
  126. exit
  127. end if
  128. settingsFile = fread("Database\Settings\Game Stats\NPCs.txt", #text)
  129. information = fread("DAT\NPC\" & name & ".txt", #text)
  130. the itemdelimiter = "/"
  131. count = settingsFile.item.count
  132. repeat with i = 1 to count
  133. the itemdelimiter = "/"
  134. settingsItem = settingsFile.item[i]
  135. the itemdelimiter = ":"
  136. if (settingsItem.item[1] = name) then settings = settingsItem
  137. end repeat
  138. sendPacket(username, "Mob/NPC Manager Loaded", [settings, information])
  139.  
  140. "Mob/NPC Manager Save":
  141. allowedRanks = ["Game Master", "Economist"]
  142. allowed = false
  143. repeat with i = 1 to allowedRanks.count
  144. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  145. end repeat
  146. if (not(allowed)) then exit
  147. settings = content[1]
  148. information = content[2]
  149. settingsFile = fread("Database\Settings\Game Stats\NPCs.txt", #text)
  150. the itemdelimiter = "/"
  151. count = settingsFile.item.count
  152. r = false
  153. repeat with i = 1 to count
  154. the itemdelimiter = "/"
  155. settingsItem = settingsFile.item[i]
  156. the itemdelimiter = ":"
  157. if (settingsItem.item[1] = settings.item[1]) then
  158. the itemdelimiter = "/"
  159. put settings into settingsFile.item[i]
  160. r = true
  161. end if
  162. end repeat
  163. if not(r) then settingsFile = settingsFile & "/" & settings
  164. fwrite("Database\Settings\Game Stats\NPCs.txt", settingsFile, #text)
  165. the itemdelimiter = ":"
  166. fwrite("DAT\NPC\" & settings.item[1] & ".txt", information, #text)
  167. sendPacket(username, "Mob/NPC Manager Saved", void)
  168. sendGameStats("@allusers")
  169.  
  170. "Mob/NPC Manager Delete":
  171. allowedRanks = ["Game Master", "Economist"]
  172. allowed = false
  173. repeat with i = 1 to allowedRanks.count
  174. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  175. end repeat
  176. if (not(allowed)) then exit
  177. settingsFile = fread("Database\Settings\Game Stats\NPCs.txt", #text)
  178. the itemdelimiter = "/"
  179. count = settingsFile.item.count
  180. repeat with i = 1 to count
  181. the itemdelimiter = "/"
  182. settingsItem = settingsFile.item[i]
  183. the itemdelimiter = ":"
  184. if (settingsItem.item[1] = content) then
  185. the itemdelimiter = "/"
  186. delete settingsFile.item[i]
  187. exit repeat
  188. end if
  189. end repeat
  190. fwrite("Database\Settings\Game Stats\NPCs.txt", settingsFile, #text)
  191. file("DAT\NPC\" & content & ".txt").delete()
  192. sendPacket(username, "Mob/NPC Manager Deleted", void)
  193. sendGameStats("@allusers")
  194.  
  195. "Item Manager Load":
  196. allowedRanks = ["Game Master", "Economist"]
  197. allowed = false
  198. repeat with i = 1 to allowedRanks.count
  199. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  200. end repeat
  201. if (not(allowed)) then exit
  202. sendPacket(username, "Item Manager Loaded", void)
  203.  
  204. "Item Manager Save":
  205. allowedRanks = ["Game Master", "Economist"]
  206. allowed = false
  207. repeat with i = 1 to allowedRanks.count
  208. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  209. end repeat
  210. if (not(allowed)) then exit
  211. fwrite("Database\Settings\Game Stats\Weapons.txt", content[1], #text)
  212. fwrite("Database\Settings\Game Stats\Helms.txt", content[2], #text)
  213. fwrite("Database\Settings\Game Stats\Armors.txt", content[3], #text)
  214. fwrite("Database\Settings\Game Stats\Shields.txt", content[4], #text)
  215. fwrite("Database\Settings\Game Stats\Boots.txt", content[5], #text)
  216. fwrite("Database\Settings\Game Stats\Foods.txt", content[6], #text)
  217. sendPacket(username, "Item Manager Saved", void)
  218. sendGameStats("@allusers")
  219.  
  220. "Quest Manager Load":
  221. allowedRanks = ["Game Master", "Quest Developer"]
  222. allowed = false
  223. repeat with i = 1 to allowedRanks.count
  224. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  225. end repeat
  226. if (not(allowed)) then exit
  227. if not(file("DAT\NPC\" & content & ".txt").exists) then
  228. sendPacket(username, "Alert", "A NPC with that name does not exist.")
  229. exit
  230. end if
  231. if not(file("Database\Quests\" & content & ".dat").exists) then
  232. sendPacket(username, "Alert", "A quest connected to that NPC does not exist.")
  233. exit
  234. end if
  235. quest = fread("Database\Quests\" & content & ".dat", #value)
  236. sendPacket(username, "Quest Manager Loaded", quest)
  237.  
  238. "Quest Manager Save":
  239. allowedRanks = ["Game Master", "Quest Developer"]
  240. allowed = false
  241. repeat with i = 1 to allowedRanks.count
  242. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  243. end repeat
  244. if (not(allowed)) then exit
  245. questList = fread("Database\Quests\Quest List.txt", #text)
  246. the itemdelimiter = "/"
  247. count = questList.item.count
  248. r = false
  249. repeat with i = 1 to count
  250. if (questList.item[i] = content.npcname) then r = true
  251. end repeat
  252. if not(r) then questList = questList & "/" & content.npcname
  253. fwrite("Database\Quests\Quest List.txt", questList, #text)
  254. fwrite("Database\Quests\" & content.npcname & ".dat", content, #value)
  255. sendPacket(username, "Quest Manager Saved", void)
  256.  
  257. "NPC Quest Check":
  258. if not(file("Database\Quests\" & content & ".dat").exists) then
  259. quest = false
  260. else
  261. quest = fread("Database\Quests\" & content & ".dat", #value)
  262. end if
  263. r = false
  264. questList = fread("Database\Characters\" & username & "-q.txt", #text)
  265. the itemdelimiter = ":"
  266. repeat with i = 1 to questList.item.count
  267. if (questList.item[i] = content) then r = true
  268. end repeat
  269. if (ilk(quest) = #propList) then
  270. if (quest.type[1] = "Social") and (r = true) then
  271. sendPacket(username, "Broadcast 0", "This quest involves you speaking to another NPC. Please read your quest log for information.")
  272. exit
  273. end if
  274. end if
  275. sendPacket(username, "NPC Quest Existence", quest)
  276.  
  277. "Start Quest":
  278. questList = fread("Database\Characters\" & username & "-q.txt", #text)
  279. if (voidP(questList)) then questList = empty
  280. the itemdelimiter = ":"
  281. repeat with i = 1 to questList.item.count
  282. if (questList.item[i] = content) then exit
  283. end repeat
  284. if (questList = empty) then
  285. questList = content
  286. else
  287. questList = questList & ":" & content
  288. end if
  289. fwrite("Database\Characters\" & username & "-q.txt", questList, #text)
  290. questKills = fread("Database\Characters\" & username & "-qk.txt", #text)
  291. quest = fread("Database\Quests\" & content & ".dat", #value)
  292. if (quest.type[1] = "Hunting") then
  293. the itemdelimiter = ":"
  294. if (voidP(questKills)) or (questKills = empty) then
  295. killCounts = content & ":" & quest.type[2].item[1] & ":0:" & quest.type[2].item[2]
  296. else
  297. killCounts = questKills & "/" & content & ":" & quest.type[2].item[1] & ":0:" & quest.type[2].item[2]
  298. end if
  299. fwrite("Database\Characters\" & username & "-qk.txt", killCounts, #text)
  300. end if
  301. sendQuestData(username)
  302. sendPacket(username, "Started Quest", void)
  303.  
  304. "Complete Quest":
  305. questList = fread("Database\Characters\" & username & "-q.txt", #text)
  306. if (voidP(questList)) then questList = empty
  307. the itemdelimiter = ":"
  308. completedQuests = fread("Database\Characters\" & username & "-cq.txt", #text)
  309. repeat with i = 1 to completedQuests.item.count
  310. if (completedQuests.item[i] = content) then exit
  311. end repeat
  312. repeat with i = 1 to questList.item.count
  313. if (questList.item[i] = content) then
  314. delete questList.item[i]
  315. exit repeat
  316. end if
  317. end repeat
  318. fwrite("Database\Characters\" & username & "-q.txt", questList, #text)
  319. quest = fread("Database\Quests\" & content & ".dat", #value)
  320. if (quest.type[1] = "Hunting") then
  321. questKills = fread("Database\Characters\" & username & "-qk.txt", #text)
  322. the itemdelimiter = "/"
  323. repeat with i = 1 to questKills.item.count
  324. the itemdelimiter = "/"
  325. listItem = questKills.item[i]
  326. the itemdelimiter = ":"
  327. if (listItem.item[1] = content) then
  328. the itemdelimiter = "/"
  329. delete questKills.item[i]
  330. exit repeat
  331. end if
  332. end repeat
  333. fwrite("Database\Characters\" & username & "-qk.txt", questKills, #text)
  334. end if
  335. if (quest.type[1] = "Gathering") then
  336. the itemdelimiter = ":"
  337. itemName = quest.type[2].item[1]
  338. amount = quest.type[2].item[2]
  339. removeFromInventory(username, itemName, amount)
  340. end if
  341. if (quest.repeatable = "NO") then
  342. if (voidP(completedQuests)) then completedQuests = empty
  343. if (completedQuests = empty) then
  344. completedQuests = content
  345. else
  346. completedQuests = completedQuests & ":" & content
  347. end if
  348. fwrite("Database\Characters\" & username & "-cq.txt", completedQuests, #text)
  349. end if
  350. sendQuestData(username)
  351. sendPacket(username, "Completed Quest", void)
  352. sendPacket(username, "Quest Experience Reward", quest.rewards.experience)
  353. sendPacket(username, "Quest Skill Reward", quest.rewards.skill)
  354. sendPacket(username, "Quest Reputation Reward", quest.rewards.reputation)
  355. if not(quest.rewards.gold = empty) then
  356. itemsFile = fread("Database\Characters\" & username & "-i.txt", #text)
  357. the itemdelimiter = "|"
  358. newGold = integer(itemsFile.item[1]) + integer(quest.rewards.gold)
  359. put string(newGold) into itemsFile.item[1]
  360. fwrite("Database\Characters\" & username & "-i.txt", itemsFile, #text)
  361. sendPacket(username, "inx", itemsFile)
  362. end if
  363. if not(quest.rewards.item = empty) then
  364. tempChest = fread("DAT\Vaults\" & username & "-TempChest.txt", #text)
  365. tempChest = quest.rewards.item & return & tempChest
  366. fwrite("DAT\Vaults\" & username & "-TempChest.txt", tempChest, #text)
  367. end if
  368. if not(quest.rewards.warp = empty) then
  369. sendPacket(username, "Warp", "!!! !!!" && quest.rewards.warp)
  370. end if
  371. PlayerLegacy = fread("Database\Characters\" & user.name & "-l.txt", #text)
  372.  
  373. if (quest.legacy[1] = "YES") then
  374. if (voidP(playerlegacy)) then playerlegacy = empty
  375. if (playerlegacy = empty) then
  376. playerlegacy = Quest.legacy[2]
  377. else
  378. playerlegacy = playerlegacy & ":" & quest.legacy[2]
  379. end if
  380. fwrite("Database\Characters\" & username & "-l.txt", playerlegacy, #text)
  381. sendpacket("@allusers", "broadcast 0", "*** " & username & " has " & Quest.Legacy[2])
  382. end if
  383.  
  384. "Save Quest Kills":
  385. fwrite("Database\Characters\" & username & "-qk.txt", content, #text)
  386.  
  387. "Save Reputation":
  388. if (voidP(content)) or (content = empty) then content = "0"
  389. fwrite("Database\Characters\" & username & "-r.txt", content, #text)
  390.  
  391. "PlayerCommand":
  392. the itemdelimiter = " "
  393.  
  394. --3a------------------------------------------------------------
  395. -- "Start CTF Event"
  396. ----------------------------------------------------------------
  397. if (content contains "start CTF") then
  398. if ColiseumFlag = 1 then EXIT
  399. the ItemDelimiter = " "
  400. arena = Content.item[3]
  401. if Arena = "" then Arena = "Default"
  402. if (getUserRank(username) = "Game Master") then
  403. StartCTFEvent(user, Movie)
  404. exit
  405. end if
  406.  
  407. end if
  408.  
  409.  
  410. --3c------------------------------------------------------------
  411. -- "Stop CTF event"
  412. ----------------------------------------------------------------
  413. if (content = "Stop CTF") then
  414.  
  415. if (getUserRank(username) = "Game Master") then
  416. StopCTFEvent(Movie, "NONE", "NONE")
  417. exit
  418. end if
  419.  
  420. end if
  421.  
  422. if (content = "Leave Event") then
  423.  
  424. if (CTFFlag = 1) then
  425. CTFJoinList = fread("DAT\CTF\Joinlist.txt", #text)
  426. the itemdelimiter = ":"
  427. repeat with x = 2 to CTFJoinList.item[1]
  428. if (CTFJoinList.item[x] = User.name) then
  429. UserCTFQuit(user, movie)
  430. RecruteCTFMSG(movie, "X")
  431. exit
  432. end if
  433. end repeat
  434. end if
  435. end if
  436.  
  437. if (content contains "Put Bounty on") then
  438. ThePerson = content.item[4]
  439. TheAmount = content.item[5]
  440. CurMap = fread("Database\GameDB\CurrentMap.dat", #value)
  441. BountyMaps = fread("Database\Settings\BountyOffice.txt", #text)
  442. the itemdelimiter = ":"
  443.  
  444.  
  445. repeat with x = 1 to bountymaps.item.count
  446. if CurMap.getaProp(symbol(UserName)) = BountyMaps.item[x] then
  447. Exit Repeat
  448. else
  449. sendpacket(username, "sqa", "This is not a bounty office!")
  450. exit
  451. end if
  452. end repeat
  453.  
  454. pBounty = fread("Database\Bountys\" & ThePerson & ".txt", #text)
  455. itemsFile = fread("Database\Characters\" & username & "-i.txt", #text)
  456. pFil = fread("Database\Characters\" & ThePerson & ".txt", #text)
  457.  
  458. if pFil = VOID then
  459. sendpacket(username, "broadcast 16", "Invalid character.")
  460. exit
  461. end if
  462.  
  463. the itemdelimiter = "|"
  464. gold = integer(itemsFile.item[1])
  465. if (gold < TheAmount) then
  466. sendPacket(username, "Broadcast 0", "*** You do not have enough gold to put a bounty on this user.")
  467. exit
  468. end if
  469. gold = gold - TheAmount
  470. put integer(gold) into itemsFile.item[1]
  471. fwrite("Database\Characters\" & username & "-i.txt", itemsFile, #text)
  472. sendPacket(username, "inx", itemsFile)
  473. sendpacket("@allusers", "Broadcast 16", "*** " & UserName & " has put a " & TheAmount & " Gold bounty on " & ThePerson & "'s Head!")
  474. if pBounty = VOID or "" then pBounty = 0
  475. pBounty = pBounty + TheAmount
  476. fwrite("Database\Bountys\" & ThePerson & ".txt", string(integer(pBounty)), #text)
  477. end if
  478.  
  479.  
  480.  
  481. ----------------------------------------------------------------
  482. -- "Start Coliseum Event"
  483. ----------------------------------------------------------------
  484. if (content = "start coliseum event") then
  485.  
  486. if CTFFlag = 1 then EXIT
  487. if (not(getUserRank(username) = "Game Master")) then
  488. exit
  489. else
  490. StartColiseumEvent(user, Movie)
  491. exit
  492. end if
  493.  
  494. end if
  495.  
  496. ----------------------------------------------------------------
  497. -- "Stop Coliseum event"
  498. ----------------------------------------------------------------
  499. if (content = "Stop Coliseum event") then
  500.  
  501. if (not(getUserRank(username) = "Game Master")) then
  502. exit
  503. else
  504. StopColiseumEvent(Movie, "NONE", "NONE")
  505. exit
  506. end if
  507.  
  508. end if
  509.  
  510.  
  511.  
  512.  
  513. ----------------------------------------------------------------
  514. -- "Fight"
  515. ----------------------------------------------------------------
  516. if (content = "Fight") then
  517. if (not(getUserRank(username) = "Game Master")) then
  518. exit
  519. else
  520. if ColiseumFlag = 1 then
  521. --put "Get Next Fighters"
  522. -------------------------
  523. ColiseumFight(user, Movie, "NONE", "NONE")
  524. exit
  525. end if
  526. end if
  527. end if
  528.  
  529. ----------------------------------------------------------------
  530. -- "join"
  531. ----------------------------------------------------------------
  532. if (content = "join") then
  533.  
  534.  
  535. if CTFFlag = 1 then Set Err = OnCTFJoin(user, movie)
  536. if ColiseumFlag = 1 then set Err = OnJoin(user, Movie)
  537. if Err = "Joined" then exit
  538.  
  539. end if
  540.  
  541.  
  542. if (content.item[1] = "Coleader") then
  543. newCo = Content.item[2]
  544. CharFil = fread("Database\Characters\" & username & ".txt" #text)
  545. the itemDelimiter = "/"
  546. Guild = CharFil.item[12]
  547. if (not(Guild = "")) then
  548. GuildDat = fread("DAT\Guilds\" & Guild & "-Leaders.txt" #text)
  549. the itemdelimiter = ":"
  550. Leader = GuildDat.item[1]
  551. if (Leader = UserName) then
  552. OldCo = GuildDat.item[2]
  553. put NewCo into GuildDat.item[2]
  554. fwrite("DAT\Guilds\" & Guild & "-Leaders.txt", GuildDat, #Text)
  555. sendpacket("@" & Guild, "broadcast 16", "<.. " & Leader & " has changed the co-leader from " & OldCo & " to " & NewCo & ".")
  556. end if
  557. end if
  558. end if
  559.  
  560. if (content.item[1] = "invite") then
  561. Player = Content.item[2]
  562. CharFil = fread("Database\Characters\" & username & ".txt" #text)
  563. the itemDelimiter = "/"
  564. Guild = CharFil.item[12]
  565. if (not(Guild = "")) then
  566. GuildDat = fread("DAT\Guilds\" & Guild & "-Leaders.txt" #text)
  567. the itemdelimiter = ":"
  568. Leader = GuildDat.item[1]
  569. CoLeader = GuildDat.item[2]
  570. if (Leader or CoLeader = username) then
  571. sendpacket(username, "InviteToGuild", Player)
  572. end if
  573. end if
  574. end if
  575.  
  576. if (content = "ColorFlood") then
  577. repeat with X = 1 to 255
  578. if (getUserRank(username) = "Game Master") then sendPacket(username, "Broadcast " & x, "Broadcast " & X)
  579. end repeat
  580. exit
  581. end if
  582.  
  583.  
  584. if (content.item[1] = "mute") then
  585. character = content.item[2]
  586. the itemdelimiter = ":"
  587. if (GameMasters contains Character) then
  588. mute(Username, Character)
  589. exit
  590. end if
  591. mute(character, username)
  592. end if
  593.  
  594. if (content.item[1] = "voice") then
  595. character = content.item[2]
  596. the itemdelimiter = ":"
  597. voice(character, username)
  598. end if
  599.  
  600. if (content = "global mute") then
  601. globalMute(username)
  602. end if
  603.  
  604. if (content.item[1] = "jail") then
  605. character = content.item[2]
  606. the itemdelimiter = ":"
  607. if (GameMasters contains Character) then
  608. Jail(Username, Character)
  609. exit
  610. end if
  611. jail(character, username)
  612. end if
  613.  
  614. if (content.item[1] = "release") then
  615. character = content.item[2]
  616. the itemdelimiter = ":"
  617. if (GameMasters contains Character) then
  618. release(Username, Character)
  619. exit
  620. end if
  621. release(character, username)
  622. end if
  623.  
  624. if (content.item[1] = "ban") then
  625. character = content.item[2]
  626. the itemdelimiter = ":"
  627. if (GameMasters contains Character) then
  628. ban(Username, Character)
  629. exit
  630. end if
  631. ban(character, username)
  632. end if
  633.  
  634. if (content.item[1] = "unban") then
  635. character = content.item[2]
  636. the itemdelimiter = ":"
  637. if not(GameMasters contains username) then exit
  638. unban(character, username)
  639. end if
  640.  
  641. if (content.item[1] = "restore") then
  642. character = content.item[2]
  643. the itemdelimiter = ":"
  644. stats = "1:190:200:200:200:200:139:91494:1/9999:99:1:20:99:99:1:1/0/0:0//1:2:3:4:5:10:12:20:21:23:30:31:32:41:43:44:45:50:52:60:61:62:70:71:72:73:75:88:40:81:83:/0/100:100:72:100:100:100:100:100:100:100:100:1:100:100:100:1:100:1:100:100:100:100:100:100:100:100:100:100:100:100:100:100:100:100:100:100:100:100/39-31-94-95-93-35-61-44-45-91-92-20-21-70-71-72-73-74-75-/39320///71"
  645. items = "800|:Fishing Pole-1:Axe-1:Saw-1:Mining Hammer-1:Blacksmith Hammer-1:Chunk of Iron-1:Blue Sand-1:Potion Bottle-3:Blue Crystals-3:Wooden Bow-1:::Minor Heal Book-1:|NOTHING:NOTHING:Wooden Sword:Blue Quiver:NOTHING:NOTHING:NOTHING"
  646. if not(GameMasters contains username) then exit
  647. ChangeStats(character, stats, items)
  648. end if
  649.  
  650. if (content.item[1] = "kick") then
  651. character = content.item[2]
  652. the itemdelimiter = ":"
  653. if (GameMasters contains Character) then
  654. kick(Username, Character)
  655. exit
  656. end if
  657. kick(character, username)
  658. end if
  659.  
  660.  
  661. if (content.item[1] = "b") then
  662. delete content.char[1]
  663. if (CTFFlag = 1) then
  664. CTFJoinList = fread("DAT\CTF\BlueTeam.txt", #text)
  665.  
  666. the itemdelimiter = ":"
  667. repeat with x = 2 to CTFJoinList.item[1]
  668. if (CTFJoinList.item[x] = Username) then
  669. sendpacket("@BlueTeam", "broadcast 190", UserName & " tells the blue team '" & Content & "'")
  670. exit
  671. end if
  672. end repeat
  673. end if
  674. end if
  675.  
  676.  
  677. if (content.item[1] = "r") then
  678. delete content.char[1]
  679. if (CTFFlag = 1) then
  680. CTFJoinList = fread("DAT\CTF\RedTeam.txt", #text)
  681.  
  682. the itemdelimiter = ":"
  683. repeat with x = 2 to CTFJoinList.item[1]
  684. if (CTFJoinList.item[x] = Username) then
  685. sendpacket("@RedTeam", "broadcast 6", UserName & " tells the red team '" & Content & "'")
  686. exit
  687. end if
  688. end repeat
  689. end if
  690. end if
  691.  
  692. if (content.item[1] = "A") then
  693. delete content.char[1]
  694. sendpacket("@Admins", "broadcast 129", UserName & " tells the Admins '" & Content & "'")
  695. end if
  696.  
  697.  
  698. if (content.item[1] = "weather") then
  699. if (not(getUserRank(username) = "Game Master")) then exit
  700. the itemdelimiter = " "
  701. weather = symbol(content.item[2])
  702. types = [#normal, #rain, #storm]
  703. if (types.getPos(weather) = 0) then
  704. sendPacket(username, "Broadcast 0", "That weather type does not exist.")
  705. exit
  706. end if
  707. gWeather = weather
  708. sendPacket("@allusers", "UpdateWeather", gWeather)
  709. sendPacket(username, "Broadcast 0", "The weather type has been changed to" && content.item[2] & ".")
  710. FloodMap(content.item[2])
  711. end if
  712.  
  713.  
  714. if (content = "buy lottery ticket") then
  715. buyLotteryTicket(username)
  716. end if
  717.  
  718. if (content.item[1] = "resetpassword") then
  719. if (not(getUserRank(username) = "Game Master")) then exit
  720. the itemdelimiter = " "
  721. character = content.item[2]
  722. newPassword = "newpass" & random(999)
  723. the itemdelimiter = ":"
  724. characterFile = fread("Database\Characters\" & character & ".txt", #text)
  725. put hash(newPassword) into characterFile.item[2]
  726. fwrite("Database\Characters\" & character & ".txt", characterFile, #text)
  727. sendPacket(username, "Broadcast 0", "You have reset" && character & "'s password to" && newPassword & ".")
  728. end if
  729.  
  730. if (content.item[1] = "nti") then
  731. allowedRanks = ["Game Master", "Economist"]
  732. allowed = false
  733. repeat with i = 1 to allowedRanks.count
  734. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  735. end repeat
  736. if (not(allowed)) then exit
  737. the itemdelimiter = " "
  738. type = content.item[2]
  739. repeat with i = 1 to 2
  740. delete content.item[1]
  741. end repeat
  742. case (type) of
  743. "add": addNonTradeable(content)
  744. "remove": removeNonTradeable(content)
  745. end case
  746. end if
  747.  
  748. if (content.item[1] = "tsc") then
  749. if (not(getUserRank(username) = "Game Master")) then exit
  750. the itemdelimiter = " "
  751. type = content.item[2]
  752. character = content.item[3]
  753. repeat with i = 1 to 3
  754. delete content.item[1]
  755. end repeat
  756. case (type) of
  757. "add":
  758. r = addToTempChest(character, content)
  759. if (r) then sendPacket(username, "Broadcast 0", "You have deposited a" && content && "into" && character & "'s temporary storage chest.")
  760. "remove":
  761. r = removeFromTempChest(character, content)
  762. if (r) then
  763. sendPacket(username, "Broadcast 0", "You have removed a" && itemName && "from" && character & "'s temporary storage chest.")
  764. else
  765. sendPacket(username, "Broadcast 0", character & "'s temporary storage chest does not contain a" && itemName & ".")
  766. end if
  767. end case
  768. end if
  769.  
  770. if (content.item[1] = "immortal") then
  771. The itemdelimiter = ":"
  772. if (not(GameMasters contains UserName)) then exit
  773. the itemdelimiter = " "
  774. character = content.item[2]
  775. the itemdelimiter = "/"
  776. characterFile = fread("Database\Characters\" & character & ".txt", #text)
  777. characterString = characterFile.item[1]
  778. immortalFile = fread("Database\Settings\Default Immortal.txt", #text)
  779. sendPacket(character, "Alert", "Your character has just been made an immortal. The changes will not take place until you reconnect to the server.")
  780. sendPacket("system.user.delete", empty, character)
  781. fwrite("Database\Characters\" & character & ".txt", characterString & immortalFile, #text)
  782. end if
  783.  
  784. if (content contains "Start DM") then
  785. allowedRanks = ["Game Master", "Quest Developer"]
  786. allowed = false
  787. repeat with i = 1 to allowedRanks.count
  788. if (getUserRank(username) = allowedRanks[i]) then allowed = true
  789. end repeat
  790. if (not(allowed)) then exit
  791. Map = Content.item[3]
  792. StartDM(Map)
  793. end if
  794.  
  795. "Action":
  796. if (content.action = "Barber Shop") then
  797. itemsFile = fread("Database\Characters\" & username & "-i.txt", #text)
  798. the itemdelimiter = "|"
  799. gold = integer(itemsFile.item[1])
  800. if (gold < content.amount) then
  801. sendPacket(username, "Broadcast 0", "*** You do not have enough gold to receive a Haircut")
  802. exit
  803. end if
  804. gold = gold - content.amount
  805. put integer(gold) into itemsFile.item[1]
  806. fwrite("Database\Characters\" & username & "-i.txt", itemsFile, #text)
  807. sendPacket(username, "inx", itemsFile)
  808. sendpacket(username, "BarberShop", EMPTY)
  809. end if
  810. if (content.action = "Pardon") then
  811. itemsFile = fread("Database\Characters\" & username & "-i.txt", #text)
  812. the itemdelimiter = "|"
  813. gold = integer(itemsFile.item[1])
  814. if (gold < content.amount) then
  815. sendPacket(username, "Broadcast 0", "*** You do not have enough gold to receive a pardon!")
  816. exit
  817. end if
  818. gold = gold - content.amount
  819. put integer(gold) into itemsFile.item[1]
  820. fwrite("Database\Characters\" & username & "-i.txt", itemsFile, #text)
  821. sendPacket(username, "inx", itemsFile)
  822. sendPacket(username, "Broadcast 0", "*** May the Gods bless you!")
  823. sendpacket(username, "PRDN", EMPTY)
  824. end if
  825. if (content.action = "INN") then
  826. itemsFile = fread("Database\Characters\" & username & "-i.txt", #text)
  827. the itemdelimiter = "|"
  828. gold = integer(itemsFile.item[1])
  829. if (gold < content.amount) then
  830. sendPacket(username, "Broadcast 0", "*** You do not have enough gold to stay here!")
  831. exit
  832. end if
  833. gold = gold - content.amount
  834. put integer(gold) into itemsFile.item[1]
  835. fwrite("Database\Characters\" & username & "-i.txt", itemsFile, #text)
  836. sendPacket(username, "inx", itemsFile)
  837. sendPacket(username, "Broadcast 0", "*** Have a good night!")
  838. the Itemdelimiter = " "
  839. NewDM = content.map.item[1] & ":" & content.map.item[2] & "-" & content.map.item[3]
  840. file("DAT\DM\" & username & ".txt").write(NewDM)
  841. sendPacket(username, "Warp", "!!! !!!" && content.map)
  842. end if
  843. sendpacket(username, "CloseWindow", "BioWindow")
  844.  
  845. "ShowLegacy":
  846. data = fread("Database\Characters\" & content & "-l.txt", #text)
  847. sendPacket(username, "ShowLegacy", [Content, data])
  848.  
  849.  
  850. "TodaysMonth":
  851. set TodaysMonth = string(content)
  852. set MyName = string(username)
  853. UpdateLastLogin(MyName)
  854.  
  855. "WriteDeathMap":
  856. if random(1000) = 1 then RunBoss(me, movie, group, user, fullMsg)
  857. set MyName = string(username)
  858. set DMap = string(content)
  859. file("DAT\DM\" & MyName & ".txt").write(DMap)
  860.  
  861. "QueryCreate":
  862. characterName = content[1]
  863. password = content[2]
  864. gender = content[3]
  865. hair = content[4]
  866.  
  867. ccount = characterName.char.count
  868. repeat with i = 1 to ccount
  869. ascii = charToNum(characterName.char[i])
  870. if not((ascii >= 65 and ascii <= 90) or (ascii >= 97 and ascii <= 122)) then
  871. sendPacket(username, "Alert", "Your character's name may only contain letters.")
  872. exit
  873. end if
  874. end repeat
  875.  
  876. if (file("Database\Characters\" & characterName & "-i.txt").exists) then
  877. sendPacket(username, "Alert", "A character with that name already exists.")
  878. exit
  879. end if
  880.  
  881. password = hash(password)
  882.  
  883. charFileString = characterName & ":" & password & ":" & hair
  884. defaultCharFile = file("Database\Settings\Default Character.txt").read()
  885. charFile = charFileString & defaultCharFile
  886. the itemdelimiter = "/"
  887. statString = charFile.item[2]
  888. the itemdelimiter = ":"
  889. put gender into statString.item[9]
  890. the itemdelimiter = "/"
  891. put statString into charFile.item[2]
  892. file("Database\Characters\" & characterName & ".txt").write(charFile)
  893.  
  894. defaultItemsFile = file("Database\Settings\Default Items.txt").read()
  895. file("Database\Characters\" & characterName & "-i.txt").write(defaultItemsFile)
  896.  
  897. file("DAT\Bank\" & characterName & ".txt").write("0")
  898. file("DAT\DM\" & characterName & ".txt").write(empty)
  899. file("DAT\Vaults\" & characterName & "-TempChest.txt").write(empty)
  900. file("Database\Characters\" & characterName & "-q.txt").write(empty)
  901. file("Database\Characters\" & characterName & "-qk.txt").write(empty)
  902. file("Database\Characters\" & characterName & "-cq.txt").write(empty)
  903. file("Database\Characters\" & characterName & "-r.txt").write(empty)
  904. file("Database\Characters\" & characterName & "-l.txt").write(empty)
  905. file("Database\Characters\" & characterName & "-PKs.txt").write("0")
  906. file("Database\Characters\" & characterName & "-PDs.txt").write("0")
  907.  
  908. sendPacket(username, "Alert", "Your character has been created successfully.")
  909. sendPacket("system.user.delete", empty, username)
  910.  
  911.  
  912. "FileTransToYou":
  913. if (not(getUserRank(username) = "Game Master")) then exit
  914. set the itemdelimiter = "~"
  915. set TheFilePath = item 1 of content
  916. set MyNewFileContent = item 2 of content
  917. file(TheFilePath).write(MyNewFileContent)
  918. User.sendMessage("sqa", "File has been uploaded.", 0, FALSE, username)
  919.  
  920.  
  921. "FileTransToMe":
  922. if (not(getUserRank(username) = "Game Master")) then exit
  923. set the itemdelimiter = ":"
  924. set TheFile = file(content).read
  925. User.sendMessage("FTSF", TheFile, 0, FALSE, username)
  926.  
  927. "WarpShortcutCreate":
  928. fwrite("Database\Warp Shortcuts\" & content[1] & ".txt", content[2], #text)
  929.  
  930. "WarpShortcutSend":
  931. if not(file("Database\Warp Shortcuts\" & content[1] & ".txt").exists) then
  932. sendPacket(username, "Broadcast 0", "This warp shortcut does not exist.")
  933. exit
  934. end if
  935. data = fread("Database\Warp Shortcuts\" & content[1] & ".txt", #text)
  936. sendPacket(content[2], "Warp", "!!! !!!" && data)
  937.  
  938. "PKCount":
  939. CTFJoinList = fread("DAT\CTF\JoinList.txt", #text)
  940.  
  941. the itemdelimiter = ":"
  942. repeat with x = 2 to CTFJoinList.item[1]
  943. if CTFJoinList.item[x] = Content then
  944. exit
  945. end if
  946. end repeat
  947.  
  948. ColiJoinList = fread("DAT\Coliseum\JoinList.txt", #text)
  949.  
  950. the itemdelimiter = ":"
  951. repeat with x = 2 to ColiJoinList.item[1]
  952. if ColiJoinList.item[x] = Content then
  953. exit
  954. end if
  955. end repeat
  956.  
  957. PKCount = fread("Database\Characters\" & content & "-PKs.txt", #text)
  958. if PKCount = VOID then PKCount = 0
  959. PKCount = integer(PKCount) + 1
  960. fwrite("Database\Characters\" & content & "-PKs.txt", string(PKCount), #text)
  961. CheckPKScore(content, PKCount)
  962. DeathCount = fread("Database\Characters\" & username & "-PDs.txt", #text)
  963. if DeathCount = VOID then DeathCount = 0
  964. DeathCount = integer(DeathCount) + 1
  965. fwrite("Database\Characters\" & username & "-PDs.txt", string(DeathCount), #text)
  966. SendPacket(Content, "PKCount", string(PKCount))
  967.  
  968. "Broadcast":
  969.  
  970. Filter = fread("Database\Settings\Filter.txt" #text)
  971. the itemDelimiter = ":"
  972. repeat with X = 1 to content.word.count
  973. repeat with y = 1 to Filter.item.Count
  974. if (content.word[x] = string(filter.item[y])) then
  975. Stars = content.word[x].char[1]
  976. repeat with C = 2 to content.word[x].char.count
  977. Stars = Stars & "*"
  978. end repeat
  979. put stars into content.word[x]
  980. end if
  981. end repeat
  982. end repeat
  983.  
  984. if (getUserRank(username) = "Player") then
  985. if (gGlobalMute) then
  986. sendPacket(username, "Broadcast 0", "Global mute is active. You are not permitted to broadcast.")
  987. exit
  988. end if
  989. end if
  990.  
  991. if not(voidP(gMuted.getAProp(symbol(username)))) then
  992. sendPacket(username, "Broadcast 0", "You are muted. You are not permitted to broadcast.")
  993. exit
  994. end if
  995.  
  996. CharFil = fread("Database\Characters\" & username & ".txt" #text)
  997. the itemDelimiter = "/"
  998. Guild = CharFil.item[12]
  999.  
  1000.  
  1001. if (not(Guild = "")) then
  1002. GuildDat = fread("DAT\Guilds\" & Guild & ".txt" #text)
  1003. GuildLeaders = fread("DAT\Guilds\" & Guild & "-leaders.txt" #text)
  1004. the itemdelimiter = ":"
  1005. if (GuildLeaders.item[1] = username) then
  1006. message = username & " leader of the " & Guild & " broadcasts " & QUOTE & content & QUOTE
  1007. else
  1008. if (GuildLeaders.item[2] = username) then
  1009. message = username & " co-leader of the " & Guild & " broadcasts " & QUOTE & content & QUOTE
  1010. else
  1011. message = username & " of the " & Guild & " broadcasts " & QUOTE & content & QUOTE
  1012. end if
  1013. end if
  1014. else
  1015. message = username & " broadcasts " & QUOTE & content & QUOTE
  1016. end if
  1017.  
  1018. userRank = getUserRank(username)
  1019. if (not(userRank = "Player")) then message = "[" & userRank & "]" && message
  1020. BCColor = fread("Database\Settings\BCColors.txt" #text)
  1021. the Itemdelimiter = ":"
  1022. if userRank = "Player" then Color = BCColor.item[6]
  1023. if (not(Guild ="")) then Color = BCColor.item[5]
  1024. if UserRank = "Economist" then Color = BCColor.item[4]
  1025. if userRank = "World Developer" then Color = BCColor.item[3]
  1026. if UserRank = "Quest Developer" then Color = BCColor.item[2]
  1027. if UserRank = "Game Master" then Color = BCColor.item[1]
  1028.  
  1029.  
  1030.  
  1031. sendPacket("@allusers", "Broadcast " & Color, message)
  1032.  
  1033. "GetGList":
  1034. set Guilds = file("DAT\GUILDS\GuildList.txt").read
  1035. User.sendMessage("GLDLST", Guilds, 0, FALSE, username)
  1036.  
  1037. "GuildCreate":
  1038. --------------------------------------------------
  1039. set MyName = string(content)
  1040. set CharFile = string(content)
  1041. set the itemdelimiter = ":"
  1042. set MyName = item 1 of MyName
  1043. The Itemdelimiter = ";"
  1044. GuildName = MyName.item[2]
  1045. set GuildDat = item 2 of CharFile
  1046. set MyFile = file("DAT\GUILDS\" & string(GuildName) & ".txt").read
  1047.  
  1048. if myFile contains "-" then
  1049.  
  1050.  
  1051.  
  1052. User.sendMessage("Server Response", "CannnotGuild", 0, FALSE, username)
  1053. else
  1054. User.sendMessage("Server Response", "Guild Created", 0, FALSE, username)
  1055. file("DAT\GUILDS\" & string(GuildName) & ".txt").write(GuildDat)
  1056. User.sendMessage("LoadGuild", GuildDat, 0, FALSE, username)
  1057. set Guilds = file("DAT\GUILDS\GuildList.txt").read
  1058. set Guilds = Guilds & GuildName & ":"
  1059. file("DAT\GUILDS\GuildList.txt").write(Guilds)
  1060. file("DAT\Guilds\" & GuildName & "-Leaders.txt").write(UserName & ":")
  1061. end if
  1062.  
  1063. "937oom":
  1064. set TheDt = string(content)
  1065. -- set FilNme = file("DAT\SETTINGS\cd.txt").read
  1066. -- put string(username) & " logs in with code: " & TheDt
  1067. if char 4 of TheDt = "" then exit
  1068. set HesLegit = 0
  1069.  
  1070. if CDKeys contains TheDt then
  1071. set LegitUsers = LegitUsers & "*" & username & "*"
  1072. User.sendMessage("okok", "x", 0, FALSE, username)
  1073. end if
  1074.  
  1075. "LoadMyGuild":
  1076. set MyName = string(content)
  1077. set the itemdelimiter = ";"
  1078. if string(content) contains ";" then set MyName = string(item 2 of content)
  1079. put MyName
  1080. set MyFile = file("DAT\GUILDS\" & string(MyName) & ".txt").read
  1081. leaderFile = fread("Dat\Guilds\" & string(MyName) & "-leaders.txt", #text)
  1082. the itemdelimiter = ":"
  1083. --put leaderfile
  1084. if LeaderFile.item[2] = string(user.name) then
  1085. repeat with x = 1 to MyFile.line.count
  1086. if MyFile.line[x] = string(user.name) then
  1087. put string(user.name) & "+" into MyFile.line[x]
  1088. exit repeat
  1089. end if
  1090. end repeat
  1091. end if
  1092. User.sendMessage("LoadGuild", MyFile, 0, FALSE, username)
  1093.  
  1094. "ViewAGuild":
  1095. set MyName = string(content)
  1096. set MyFile = file("DAT\GUILDS\" & string(MyName) & ".txt").read
  1097. User.sendMessage("ViewAGuild", MyFile, 0, FALSE, username)
  1098.  
  1099.  
  1100. "GuildDell":
  1101. set GuildToDel = string(content)
  1102. set Guilds = file("DAT\GUILDS\GuildList.txt").read
  1103. set the itemdelimiter = ":"
  1104. set NewList = ""
  1105. repeat with x = 1 to 800
  1106. if item x of Guilds <> "" then
  1107. if item x of Guilds <> GuildToDel then set NewList = NewList & item x of Guilds & ":"
  1108. end if
  1109. end repeat
  1110. file("DAT\GUILDS\GuildList.txt").write(NewList)
  1111. --------------------------------------------------
  1112. "LoadChar":
  1113. set tDT = string(content)
  1114. set CharFile = string(content)
  1115. set the itemdelimiter = ":"
  1116. set MyName = item 1 of tDT
  1117. set PPW = item 2 of tDT
  1118. set MyCode = item 3 of tDT
  1119.  
  1120. set HesOK = FALSE
  1121. set HesOK = TRUE
  1122.  
  1123. set MyFile = file("Database\Characters\" & string(MyName) & ".txt").read
  1124. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1125.  
  1126. PPW = hash(PPW)
  1127.  
  1128. if myFile contains ":" then
  1129. if item 2 of string(MyFile) = PPW then
  1130. reputation = fread("Database\Characters\" & username & "-r.txt", #text)
  1131. if (voidP(reputation)) or (reputation = empty) then reputation = "0"
  1132. sendPacket(username, "Load Reputation", reputation)
  1133. PKCount = fread("Database\Characters\" & username & "-PKs.txt", #text)
  1134. if (voidP(reputation)) or (reputation = empty) then PKCount = "0"
  1135. sendPacket(username, "PKCount", PKCount)
  1136. set MyFile = string("!!!" & MyFile)
  1137. User.sendMessage("Server Response", MyFile, 0, FALSE, username)
  1138. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  1139. set FactionPowers = file("DAT\POLITICAL\factions.txt").read
  1140. User.sendMessage("factnrtrn", FactionPowers, 0, FALSE, username)
  1141. charAmount = fileCount("Database\Characters") / 9
  1142. mapAmount = fileCount("DAT\Maps")
  1143. User.sendMessage("sqa", "Welcome to Darkness Ruin. We currently have" && charAmount && "characters in our database and the world consists of" && mapAmount && "maps.", 0, FALSE, username)
  1144. --set FilName = "DAT\ASSASSINS\MODE.txt"
  1145. --set AssSystem = file(FilName).read
  1146. --if AssSystem contains "LIGHT" then User.sendMessage("ltass", "x", 0, FALSE, username)
  1147. sendPacket(username, "MenuType", getUserRank(username))
  1148. set FxilName = "DAT\SETTINGS\System.txt"
  1149. set SysFill = file(FxilName).read
  1150. if SysFill contains "Speed Hack Protection:OFF" then User.sendMessage("DontSHP", "x", 0, FALSE, username)
  1151. set FilName = "DAT\SETTINGS\Guest Access.txt"
  1152. set MyFile = file(FilName).read
  1153. if MyFile contains "OFF" then User.sendMessage("455934785938612364852348", "455934785938612364852348", 0, FALSE, username)
  1154. sendPacket(username, "UpdateWeather", gWeather)
  1155. sendGameStats(username)
  1156. sendQuestData(username)
  1157. else
  1158. User.sendMessage("Server Response", "Invalid PW", 0, FALSE, username)
  1159. end if
  1160. else
  1161. User.sendMessage("Server Response", "Nonexistant", 0, FALSE, username)
  1162. end if
  1163. --------------------------------------------------
  1164.  
  1165. "SupaWarp":
  1166. if (getUserRank(username) = "Player") or (getUserRank(username) = "Moderator") then exit
  1167. set the itemdelimiter = "*"
  1168. set WarpUser = string(item 1 of content)
  1169. set WarpDat = string(item 2 of content)
  1170. movie.sendMessage(WarpUser, "Warp", WarpDat)
  1171.  
  1172. "cq1":
  1173. set FilName = string(username) & ".txt"
  1174. set xFilName = string(fullmsg.SenderID) & ".txt"
  1175. set HisName = string(fullmsg.SenderID)
  1176. set SrStr = "*" & username & "*"
  1177.  
  1178. if FilName <> xFilName then
  1179. set MyFile = file("Database\Characters\" & string(HisName) & ".txt").read
  1180. set MyFile = "BANNED!!!!!!!!!!!" & MyFile
  1181. file("Database\Characters\" & string(HisName) & ".txt").write(MyFile)
  1182. User.sendMessage("YouGotKicked", "The Mighty Server God", 0, FALSE, username)
  1183. exit
  1184. end if
  1185.  
  1186. set FilDT = string(content)
  1187.  
  1188. the itemdelimiter = ":"
  1189. put hash(FilDT.item[2]) into FilDT.item[2]
  1190.  
  1191. set the itemdelimiter = "."
  1192. if item 1 of FilDT <> string(username) then exit
  1193. set HisName = string(username)
  1194. set FilName = HisName & ".txt"
  1195. if HisName contains "NewChar" then exit
  1196. file("Database\Characters\" & FilName).write(FilDt)
  1197.  
  1198. "SaveGuild":
  1199. set FileDT = string(content)
  1200. set the itemdelimiter = "`"
  1201. set FilName = item 1 of FileDT
  1202. set FilDat = item 2 of FileDT
  1203. LeaderFile = fread("Dat\Guilds\" & FilName & "-leaders.txt", #text)
  1204. the itemdelimiter = ":"
  1205. put FilDat.line[1] into LeaderFile.item[1]
  1206. fwrite("Dat\Guilds" & FilName & "-leaders.txt", LeaderFile, #text)
  1207. file("DAT\GUILDS\" & FilName).write(FilDat)
  1208.  
  1209. --------------------------------------------------
  1210. "SaveItems":
  1211.  
  1212. set FileDT = string(content)
  1213. set the itemdelimiter = "`"
  1214. set FilName = item 1 of FileDT
  1215. set FilDat = item 2 of FileDT
  1216.  
  1217. file("DAT\ITEMS\" & FilName).write(FilDat)
  1218. --------------------------------------------------
  1219. "HckItm":
  1220.  
  1221. set FileDT = string(content)
  1222. set the itemdelimiter = "`"
  1223. set FilName = item 1 of FileDT
  1224. set NewItem = item 2 of FileDT
  1225. set ItDt = item 2 of FileDT
  1226. set ItemList = file("DAT\ITEMS\" & FilName).read
  1227.  
  1228. if ItemList contains NewItem then
  1229. set the itemdelimiter = "|"
  1230.  
  1231. repeat with itemIndexs = 1 to 20
  1232. if NewItem = item itemIndexs of Itemlist then put "" into item itemIndexs of ItemList
  1233. end repeat
  1234.  
  1235. file("DAT\ITEMS\" & FilName).write(ItemList)
  1236. else
  1237. end if
  1238.  
  1239. --------------------------------------------------
  1240. "remEQ":
  1241.  
  1242. set Joinlist = file("DAT\CTF\Joinlist.txt").read
  1243. if CTFFlag = 1 and Joinlist contains user.name then
  1244. if fullmsg.content contains "Murder Helm" or fullmsg.content contains "War Helm" or fullmsg.content contains "Blue CTF Flag" or fullmsg.content contains "Red CTF Flag" then
  1245. sendpacket(Username, "Sqa", "you cannot unequip your helmet or Wings during ctf.")
  1246. exit
  1247. end if
  1248. end if
  1249.  
  1250. set FileDT = string(content)
  1251. set the itemdelimiter = ":"
  1252. set ItemToRemove = item 1 of FileDT
  1253. set ItemType = item 2 of FileDT
  1254. if ItemToRemove = "NOTHING" then exit
  1255.  
  1256. set MyName = username
  1257. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1258. set the itemdelimiter = "|"
  1259. set MyEquipment = item 2 of MyItemsFile
  1260. set MyEquipped = item 3 of MyItemsFile
  1261. set the itemdelimiter = ":"
  1262.  
  1263. set ItsAGo = 0
  1264.  
  1265. repeat with xxx = 1 to 15
  1266. if item xxx of MyEquipment = "" then set ItsAGo = 1
  1267. end repeat
  1268.  
  1269. if MyEquipment contains ItemToRemove then set ItsAGo = 1
  1270.  
  1271. if ItsAGo < 1 then
  1272. User.sendMessage("flinv", MyItemsFile, 0, FALSE, username)
  1273. exit
  1274. end if
  1275.  
  1276. if ItemType = "Head" then set EquipSlot = 1
  1277. if ItemType = "Body" then set EquipSlot = 2
  1278. if ItemType = "LeftHand" then set EquipSlot = 3
  1279. if ItemType = "RightHand" then set EquipSlot = 4
  1280. if ItemType = "Feet" then set EquipSlot = 5
  1281. if ItemType = "Ring" then set EquipSlot = 6
  1282.  
  1283. if item EquipSlot of MyEquipped = ItemToRemove then
  1284. put "NOTHING" into item EquipSlot of MyEquipped
  1285. set the itemdelimiter = "|"
  1286. put MyEquipped into item 3 of MyItemsFile
  1287.  
  1288. set nItem = ItemtoRemove
  1289. set ItemNum = 1
  1290. InvAdd(MyName, MyItemsFile, nItem, ItemNum, user, fullmsg, group, movie)
  1291. exit
  1292. end if
  1293.  
  1294. User.sendMessage("sqa", "You've already unequipped this!.", 0, FALSE, username)
  1295.  
  1296. ----------------------
  1297. "SaveNewsPaper":
  1298. file("DAT\NEWSPAPERS\" & string(username) & ".txt").write(string(content))
  1299.  
  1300. "ReadNewspaperGUI":
  1301. set NewsName = string(username) & ".txt"
  1302. set NPFile = file("DAT\NEWSPAPERS\" & NewsName).read
  1303. User.sendMessage("NewspaperX", NPFile, 0, FALSE, username)
  1304.  
  1305. "ReadNewspaper":
  1306. set NewsName = string(content) & ".txt"
  1307. set NPFile = file("DAT\NEWSPAPERS\" & NewsName).read
  1308. User.sendMessage("Newspaper", NPFile, 0, FALSE, username)
  1309. set the itemdelimiter = "`"
  1310. set Photo1 = item 1 of NPFile
  1311. set Photo2 = item 2 of NPFile
  1312. set Photo3 = item 3 of NPFile
  1313. set ThePainting = file("DAT\ART\" & Photo1).readvalue()
  1314. User.sendMessage("Photo1Send", ThePainting, 0, FALSE, username)
  1315. set ThePainting = file("DAT\ART\" & Photo2).readvalue()
  1316. User.sendMessage("Photo2Send", ThePainting, 0, FALSE, username)
  1317. set ThePainting = file("DAT\ART\" & Photo3).readvalue()
  1318. User.sendMessage("Photo3Send", ThePainting, 0, FALSE, username)
  1319.  
  1320. "rhnd":
  1321. set FileDT = string(content)
  1322. set the itemdelimiter = ":"
  1323. set ItemToRemove = item 1 of FileDT
  1324. set ItemType = item 2 of FileDT
  1325.  
  1326. set MyName = username
  1327. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1328. set the itemdelimiter = "|"
  1329. set MyEquipped = item 3 of MyItemsFile
  1330. set the itemdelimiter = ":"
  1331.  
  1332. put "NOTHING" into item 4 of MyEquipped
  1333.  
  1334. set the itemdelimiter = "|"
  1335. put MyEquipped into item 3 of MyItemsFile
  1336. file("Database\Characters\" & string(MyName & "-i") & ".txt").write(MyItemsFile)
  1337. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  1338.  
  1339. "rtrninv":
  1340. set MyName = username
  1341. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1342. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  1343.  
  1344. -------------- ###
  1345. "SavePainting":
  1346. set MyName = username
  1347. set FileNme = random(10000000)
  1348. set TheImage = content
  1349. file("DAT\ART\" & string(FileNme) & ".txt").write(String(MyName))
  1350. file("DAT\ART\" & FileNme).writevalue(TheImage)
  1351. User.sendMessage("OKPaint", "x", 0, FALSE, username)
  1352. set nItem = "Painting#" & FileNme
  1353. set ItemNum = 1
  1354. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1355. InvAdd(MyName, MyItemsFile, nItem, ItemNum, user, fullmsg, group, movie)
  1356.  
  1357. "SaveTheBigMap":
  1358. set MyName = username
  1359. set TheImage = content
  1360. file("DAT\WORLD MAP\WMAP").writevalue(TheImage)
  1361. User.sendMessage("TheBigMapWasSaved", "x", 0, FALSE, username)
  1362.  
  1363. "GrabTheBigMap":
  1364. set TheBigMap = file("DAT\WORLD MAP\WMAP").readvalue()
  1365. User.sendMessage("HeresTheBigMap", TheBigMap, 0, FALSE, username)
  1366.  
  1367. "ViewPainting":
  1368. set CodeNum = string(content)
  1369. set PaintingAuthor = file("DAT\ART\" & CodeNum & ".txt").read
  1370. User.sendMessage("PaintingAuthor", PaintingAuthor, 0, FALSE, username)
  1371. set ThePainting = file("DAT\ART\" & CodeNum).readvalue()
  1372. User.sendMessage("ViewPainting", ThePainting, 0, FALSE, username)
  1373. -------------- ###
  1374. "SavePhoto":
  1375. set MyName = username
  1376. set FileNme = random(10000000)
  1377. set TheImage = content
  1378. file("DAT\ART\" & string(FileNme) & ".txt").write(String(MyName))
  1379. file("DAT\ART\" & FileNme).writevalue(TheImage)
  1380. User.sendMessage("OKPaint", "x", 0, FALSE, username)
  1381. set nItem = "Photo#" & FileNme
  1382. set ItemNum = 1
  1383. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1384. InvAdd(MyName, MyItemsFile, nItem, ItemNum, user, fullmsg, group, movie)
  1385.  
  1386. "DestroyNTI":
  1387. removeFromInventory(username, content, 1)
  1388. sendPacket(username, "Broadcast 0", "Your" && content && "has been destroyed.")
  1389.  
  1390. "EqNfo":
  1391. set FileDT = string(content)
  1392. set the itemdelimiter = ":"
  1393. set ItemToEquip = item 1 of FileDT
  1394. set ItemIndex = integer(item 2 of FileDT)
  1395. set EquipType = item 3 of FileDT
  1396.  
  1397. set MyName = username
  1398. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1399. set the itemdelimiter = "|"
  1400. set MyEquipment = item 2 of MyItemsFile
  1401. set MyEquipped = item 3 of MyItemsFile
  1402. set the itemdelimiter = ":"
  1403.  
  1404. if item ItemIndex of MyEquipment contains ItemToEquip & "-" then
  1405. if EquipType = "Head" then set EquipSlot = 1
  1406. if EquipType = "Body" then set EquipSlot = 2
  1407. if EquipType = "LeftHand" then set EquipSlot = 3
  1408. if EquipType = "RightHand" then set EquipSlot = 4
  1409. if EquipType = "Feet" then set EquipSlot = 5
  1410. if EquipType = "Ring" then set EquipSlot = 6
  1411. if EquipType = "Shoulder" then set EquipSlot = 7
  1412. if EquipSlot < 1 then exit
  1413. set ItemToSwitch = item EquipSlot of MyEquipped
  1414. put ItemToEquip into item EquipSlot of MyEquipped
  1415.  
  1416. if ItemToSwitch <> "NOTHING" then
  1417. put ItemToSwitch into item ItemIndex of MyEquipment
  1418. else
  1419. put "" into item ItemIndex of MyEquipment
  1420. end if
  1421.  
  1422. set the itemdelimiter = "|"
  1423. put MyEquipped into item 3 of MyItemsFile
  1424.  
  1425. if ItemToSwitch <> "NOTHING" then
  1426. set RemItem = ItemToSwitch
  1427. set AddItem = ItemToEquip
  1428. setItemNum = 1
  1429. set dattt = "You have to remove the current item you are wearing to equip this."
  1430. User.sendMessage("sqa", dattt, 0, FALSE, username)
  1431. exit
  1432. end if
  1433.  
  1434. set nItem = ItemToEquip
  1435. set ItemNum = 1
  1436. InvDel(MyName, MyItemsFile, nItem, ItemNum, User, fullmsg, group, movie)
  1437. end if
  1438.  
  1439.  
  1440. --------------------------------------------------
  1441. --------------------------------------------------
  1442. "KeyUsage":
  1443. set FileDT = string(content)
  1444.  
  1445. set the itemdelimiter = ":"
  1446. set ItemName = item 1 of FileDT
  1447. set InvenNum = integer(item 2 of FileDT)
  1448. set KeyFile = file("DAT\SETTINGS\Keys.txt").read
  1449. if KeyFile contains ItemName & ":Inf" then exit
  1450.  
  1451. set MyName = username
  1452. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1453. set the itemdelimiter = "|"
  1454. set MyEquipment = item 2 of MyItemsFile
  1455. set the itemdelimiter = ":"
  1456.  
  1457. set MyItemToDrop = item InvenNum of MyEquipment
  1458.  
  1459. if MyItemToDrop contains ItemName & "-" then
  1460. set nItem = ItemName
  1461. set ItemNum = 1
  1462. InvDel(MyName, MyItemsFile, nItem, ItemNum, User, fullmsg, group, movie)
  1463. end if
  1464.  
  1465.  
  1466. "RemItmInv":
  1467. set FileDT = string(content)
  1468.  
  1469. set the itemdelimiter = ":"
  1470. set ItemName = item 1 of FileDT
  1471. set InvenNum = integer(item 2 of FileDT)
  1472.  
  1473. set MyName = username
  1474. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1475. set the itemdelimiter = "|"
  1476. set MyEquipment = item 2 of MyItemsFile
  1477. set the itemdelimiter = ":"
  1478.  
  1479. set MyItemToDrop = item InvenNum of MyEquipment
  1480.  
  1481. if MyItemToDrop contains ItemName & "-" then
  1482. set nItem = ItemName
  1483. set ItemNum = 1
  1484. InvDel(MyName, MyItemsFile, nItem, ItemNum, User, fullmsg, group, movie)
  1485. end if
  1486.  
  1487.  
  1488. --------------------------------------------------
  1489. "DropCrystals":
  1490. set FileDT = string(content)
  1491.  
  1492. set the itemdelimiter = "`"
  1493. set FilName = item 1 of FileDT
  1494. set NewItem = item 2 of FileDT
  1495. set ItDt = item 2 of FileDT
  1496. set ItemList = file("DAT\ITEMS\" & FilName).read
  1497. set the ItemDelimiter = "|"
  1498. if item 20 of ItemList = "" then set OneToPlace = 20
  1499. if item 19 of ItemList = "" then set OneToPlace = 19
  1500. if item 18 of ItemList = "" then set OneToPlace = 18
  1501. if item 17 of ItemList = "" then set OneToPlace = 17
  1502. if item 16 of ItemList = "" then set OneToPlace = 16
  1503. if item 15 of ItemList = "" then set OneToPlace = 15
  1504. if item 14 of ItemList = "" then set OneToPlace = 14
  1505. if item 13 of ItemList = "" then set OneToPlace = 13
  1506. if item 12 of ItemList = "" then set OneToPlace = 12
  1507. if item 11 of ItemList = "" then set OneToPlace = 11
  1508. if item 10 of ItemList = "" then set OneToPlace = 10
  1509. if item 9 of ItemList = "" then set OneToPlace = 9
  1510. if item 8 of ItemList = "" then set OneToPlace = 8
  1511. if item 7 of ItemList = "" then set OneToPlace = 7
  1512. if item 6 of ItemList = "" then set OneToPlace = 6
  1513. if item 5 of ItemList = "" then set OneToPlace = 5
  1514. if item 4 of ItemList = "" then set OneToPlace = 4
  1515. if item 3 of ItemList = "" then set OneToPlace = 3
  1516. if item 2 of ItemList = "" then set OneToPlace = 2
  1517. if item 1 of ItemList = "" then set OneToPlace = 1
  1518.  
  1519. set the itemdelimiter = ":"
  1520. set TheGoods = item 1 of ItDt & ":" & item 2 of ItDt
  1521. set the ItemDelimiter = "|"
  1522. put TheGoods into item OnetoPlace of ItemList
  1523.  
  1524. if ItemList contains "|" then
  1525.  
  1526. else
  1527. exit
  1528. end if
  1529.  
  1530. set MyName = username
  1531. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1532. set the itemdelimiter = "|"
  1533. set MyEquipment = item 2 of MyItemsFile
  1534. set the itemdelimiter = ":"
  1535. set CurItemDrop = item 1 of NewItem
  1536. set the itemdelimiter = " "
  1537. set CurItemDropx = item 2 of CurItemDrop & " " & item 3 of CurItemDrop
  1538. set nItem = CurItemDropx
  1539. set ItemNum = integer(item 1 of CurItemDrop)
  1540.  
  1541. set the itemdelimiter = ":"
  1542. set InvenNum = integer(item 3 of FileDT)
  1543. set MyItemToDrop = item InvenNum of MyEquipment
  1544.  
  1545. if MyItemToDrop contains nItem & "-" then
  1546. set the itemdelimiter = "-"
  1547. set CurrentAmount = integer(item 2 of MyItemToDrop)
  1548. if CurrentAmount < ItemNum then
  1549. set TextNfo = "You don't have enough to drop this amount!"
  1550. User.sendMessage("sqa", TextNfo, 0, FALSE, username)
  1551. exit
  1552. end if
  1553. file("DAT\ITEMS\" & FilName).write(ItemList)
  1554. InvDel(MyName, MyItemsFile, nItem, ItemNum, User, fullmsg, group, movie)
  1555. end if
  1556. -------------------------------------------------- * ** * * * * * * * * ** * * * ** * *
  1557. "RmCr":
  1558. set FileDT = string(content)
  1559. set the itemdelimiter = ":"
  1560. set CrName = item 1 of FileDT
  1561. set Amount = integer(item 2 of FileDT)
  1562. set InvenNum = item 3 of FileDT
  1563. if InvenNum <> "x" then set InvenNum = integer(InvenNum )
  1564. if Amount < 1 then set Amount = 1
  1565.  
  1566. set MyName = username
  1567. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1568. set the itemdelimiter = "|"
  1569. set MyEquipment = item 2 of MyItemsFile
  1570. set the itemdelimiter = ":"
  1571.  
  1572. if InvenNum = "x" then
  1573. repeat with xx = 1 to 15
  1574. if item xx of MyEquipment contains CrName & "-" then set InvenNum = xx
  1575. end repeat
  1576. end if
  1577.  
  1578. set MyLine = item InvenNum of MyEquipment
  1579.  
  1580. if MyLine contains CrName & "-" then
  1581. set the itemdelimiter = "-"
  1582. set CurrentAmount = integer(item 2 of MyLine)
  1583.  
  1584. if CurrentAmount < Amount then
  1585. exit
  1586. end if
  1587.  
  1588. set nItem = CrName
  1589. set ItemNum = Amount
  1590. InvDel(MyName, MyItemsFile, nItem, ItemNum, User, fullmsg, group, movie)
  1591. end if
  1592. -------------------------------------------------- * * ** * * * ** * * * * * * * *
  1593.  
  1594. "AddToQueue":
  1595. Global MovementQueue
  1596. set DtToAdd = string(content)
  1597. set the itemdelimiter = ":"
  1598. set WhichMap = item 1 of DtToAdd
  1599. set the itemdelimiter = "`"
  1600.  
  1601. repeat with x = 1 to 7
  1602. if item x of MovementQueue contains WhichMap & ":" then
  1603. set theLine = item x of MovementQueue & DtToAdd & "/"
  1604. put theLine into item x of MovementQueue
  1605. exit
  1606. end if
  1607. end repeat
  1608.  
  1609. if MovementQueue = "" then
  1610. set MovementQueue = DtToAdd & "/"
  1611. exit
  1612. end if
  1613.  
  1614. set MovementQueue = MovementQueue & "`" & DtToAdd & "/"
  1615.  
  1616. "DropAnItemX":
  1617. set Flag = CTFDroptrigger(user, fullmsg, Movie)
  1618. set FileDT = string(content)
  1619.  
  1620. the itemdelimiter = ":"
  1621. location = FileDT.item[2]
  1622. the itemdelimiter = "-"
  1623. if (location.item[1] < 46) or (location.item[1] > 558) or (location.item[2] < 29) or (location.item[2] > 381) then exit
  1624.  
  1625. set the itemdelimiter = "`"
  1626. set FilName = item 1 of FileDT
  1627. set NewItem = item 2 of FileDT
  1628.  
  1629. set ItDt = item 2 of FileDT
  1630. set ItemList = file("DAT\ITEMS\" & FilName).read
  1631. set the ItemDelimiter = "|"
  1632. if item 20 of ItemList = "" then set OneToPlace = 20
  1633. if item 19 of ItemList = "" then set OneToPlace = 19
  1634. if item 18 of ItemList = "" then set OneToPlace = 18
  1635. if item 17 of ItemList = "" then set OneToPlace = 17
  1636. if item 16 of ItemList = "" then set OneToPlace = 16
  1637. if item 15 of ItemList = "" then set OneToPlace = 15
  1638. if item 14 of ItemList = "" then set OneToPlace = 14
  1639. if item 13 of ItemList = "" then set OneToPlace = 13
  1640. if item 12 of ItemList = "" then set OneToPlace = 12
  1641. if item 11 of ItemList = "" then set OneToPlace = 11
  1642. if item 10 of ItemList = "" then set OneToPlace = 10
  1643. if item 9 of ItemList = "" then set OneToPlace = 9
  1644. if item 8 of ItemList = "" then set OneToPlace = 8
  1645. if item 7 of ItemList = "" then set OneToPlace = 7
  1646. if item 6 of ItemList = "" then set OneToPlace = 6
  1647. if item 5 of ItemList = "" then set OneToPlace = 5
  1648. if item 4 of ItemList = "" then set OneToPlace = 4
  1649. if item 3 of ItemList = "" then set OneToPlace = 3
  1650. if item 2 of ItemList = "" then set OneToPlace = 2
  1651. if item 1 of ItemList = "" then set OneToPlace = 1
  1652.  
  1653. set the itemdelimiter = ":"
  1654.  
  1655. if item 1 of ItDt = "Newspaper Kit" then
  1656. put string(username) & "'s Newspaper" into item 1 of ItDt
  1657. end if
  1658.  
  1659. set TheGoods = item 1 of ItDt & ":" & item 2 of ItDt
  1660. set the ItemDelimiter = "|"
  1661. put TheGoods into item OnetoPlace of ItemList
  1662.  
  1663. if ItemList contains "|" then
  1664. else
  1665. exit
  1666. end if
  1667.  
  1668. set MyName = username
  1669. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1670. set the itemdelimiter = "|"
  1671. set MyEquipment = item 2 of MyItemsFile
  1672. set the itemdelimiter = ":"
  1673. set CurItemDrop = item 1 of NewItem
  1674. set InvenNum = integer(item 3 of FileDT)
  1675. set MyItemToDrop = item InvenNum of MyEquipment
  1676.  
  1677. if MyItemToDrop contains CurItemDrop & "-" then
  1678.  
  1679. if Flag = "Blue CTF Flag" then
  1680. set FlagPositionOne = CheckCTFFlagPosition(user, movie, 5, ItemList)
  1681. set FlagPositionTwo = CheckCTFFlagPosition(user, movie, 6, ItemList)
  1682. put FlagPositionTwo & " " & FlagPositionOne
  1683. if FlagPositionOne = "flag is in possition" and FlagPositionTwo = "flag is in possition" then
  1684. AddCTFScore(user, "RedTeam", movie)
  1685. ReplaceCTFItemlist(User.Name, movie, "RedTeam")
  1686. RespawCTFlag(user, "BlueTeam", movie)
  1687. DeleteFlags(Flag)
  1688. exit
  1689. end if
  1690. end if
  1691.  
  1692. if Flag = "Red CTF Flag" then
  1693.  
  1694.  
  1695. set FlagPositionOne = CheckCTFFlagPosition(user, movie, 4, ItemList)
  1696. set FlagPositionTwo = CheckCTFFlagPosition(user, movie, 7, ItemList)
  1697. if FlagPositionOne = "flag is in possition" and FlagPositionTwo = "flag is in possition" then
  1698. AddCTFScore(user, "BlueTeam", movie)
  1699. ReplaceCTFItemlist(User.Name, movie, "BlueTeam")
  1700. RespawCTFlag(user, "RedTeam", movie)
  1701. DeleteFlags(Flag)
  1702. exit
  1703. end if
  1704. end if
  1705.  
  1706. file("DAT\ITEMS\" & FilName).write(ItemList)
  1707.  
  1708.  
  1709.  
  1710. set nItem = CurItemDrop
  1711. set ItemNum = 1
  1712. InvDel(MyName, MyItemsFile, nItem, ItemNum, User, fullmsg, group, movie)
  1713.  
  1714. if Flag = "Blue CTF Flag" then ReplaceCTFItemlist(User.Name, movie, "RedTeam")
  1715. if Flag = "Red CTF Flag" then ReplaceCTFItemlist(User.Name, movie, "BlueTeam")
  1716. end if
  1717. --------------------------------------------------
  1718. "DropSomeGold":
  1719. set FileDT = string(content)
  1720.  
  1721. set the itemdelimiter = "`"
  1722. set FilName = item 1 of FileDT
  1723. set NewItem = item 2 of FileDT
  1724. set ItDt = item 2 of FileDT
  1725. set ItemList = file("DAT\ITEMS\" & FilName).read
  1726. set the ItemDelimiter = "|"
  1727. if item 20 of ItemList = "" then set OneToPlace = 20
  1728. if item 19 of ItemList = "" then set OneToPlace = 19
  1729. if item 18 of ItemList = "" then set OneToPlace = 18
  1730. if item 17 of ItemList = "" then set OneToPlace = 17
  1731. if item 16 of ItemList = "" then set OneToPlace = 16
  1732. if item 15 of ItemList = "" then set OneToPlace = 15
  1733. if item 14 of ItemList = "" then set OneToPlace = 14
  1734. if item 13 of ItemList = "" then set OneToPlace = 13
  1735. if item 12 of ItemList = "" then set OneToPlace = 12
  1736. if item 11 of ItemList = "" then set OneToPlace = 11
  1737. if item 10 of ItemList = "" then set OneToPlace = 10
  1738. if item 9 of ItemList = "" then set OneToPlace = 9
  1739. if item 8 of ItemList = "" then set OneToPlace = 8
  1740. if item 7 of ItemList = "" then set OneToPlace = 7
  1741. if item 6 of ItemList = "" then set OneToPlace = 6
  1742. if item 5 of ItemList = "" then set OneToPlace = 5
  1743. if item 4 of ItemList = "" then set OneToPlace = 4
  1744. if item 3 of ItemList = "" then set OneToPlace = 3
  1745. if item 2 of ItemList = "" then set OneToPlace = 2
  1746. if item 1 of ItemList = "" then set OneToPlace = 1
  1747.  
  1748. set the itemdelimiter = ":"
  1749. set stuffin = item 1 of ItDt & ":" & item 2 of ItDt
  1750. set the ItemDelimiter = "|"
  1751. put stuffin into item OnetoPlace of ItemList
  1752.  
  1753. if ItemList contains "|" then
  1754. else
  1755. exit
  1756. end if
  1757.  
  1758. set MyName = username
  1759. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1760. set the itemdelimiter = "|"
  1761. set MyGold = integer(item 1 of MyItemsFile)
  1762. set the itemdelimiter = ":"
  1763. set CurItemDrop = item 1 of NewItem
  1764. set the itemdelimiter = " "
  1765. set GoldAmount = integer(item 1 of CuritemDrop)
  1766.  
  1767. if MyGold >= GoldAmount then
  1768. set MyGold = MyGold - GoldAmount
  1769. put "" into item InvenNum of MyEquipment
  1770. set the itemdelimiter = "|"
  1771. put MyGold into item 1 of MyItemsFile
  1772. file("Database\Characters\" & string(MyName & "-i") & ".txt").write(MyItemsFile)
  1773. file("DAT\ITEMS\" & FilName).write(ItemList)
  1774. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  1775. end if
  1776. ----------------- * * *
  1777.  
  1778. "AddMeToCheaters":
  1779. AddMeToCheaters(me, movie, group, user, fullmsg)
  1780.  
  1781. "ViewCheaters":
  1782. ViewCheaters(me, movie, group, user, fullmsg)
  1783.  
  1784. "SecureTradeInProgress":
  1785. SecureTradeInProgress(me, movie, group, user, fullmsg)
  1786.  
  1787. "b94013":
  1788. DisxItm(me, movie, group, user, fullmsg)
  1789.  
  1790. "x91":
  1791. RunAdd(me, movie, group, user, fullmsg)
  1792.  
  1793. "bookrd":
  1794. ReadBook(me, movie, group, user, fullmsg)
  1795.  
  1796. "bjchk":
  1797. BlackJackGoldCheck(me, movie, group, user, fullmsg)
  1798.  
  1799. "snx38":
  1800. snx38(me, movie, group, user, fullmsg)
  1801.  
  1802. "GiveToPlayer":
  1803. GiveToPlayer(me, movie, group, user, fullmsg)
  1804.  
  1805. "GiveGoldToPlayer":
  1806. GiveGoldToPlayer(me, movie, group, user, fullmsg)
  1807.  
  1808. "QuestGive":
  1809. QuestGive(me, movie, group, user, fullmsg)
  1810.  
  1811. "RefNPC":
  1812. RefNPC(me, movie, group, user, fullmsg)
  1813.  
  1814. "GetSomeFaction":
  1815. User.sendMessage("factnrtrn", FactionPowers, 0, FALSE, username)
  1816.  
  1817. "DoorSwitch":
  1818. set FileDT = string(content)
  1819. set the itemdelimiter = "|"
  1820. set MapName = item 1 of FileDT
  1821. set OldDoor = item 2 of FileDT
  1822. set NewDoor = item 3 of FileDT
  1823.  
  1824. set MapFile = file("DAT\ITEMS\" & MapName).read
  1825.  
  1826. repeat with x = 1 to 20
  1827. if item x of MapFile contains OldDoor then
  1828. set DoorFL = item x of MapFile
  1829. set the itemdelimiter = ":"
  1830. put NewDoor into item 1 of DoorFL
  1831. set the itemdelimiter = "|"
  1832. put DoorFL into item x of MapFile
  1833. end if
  1834. end repeat
  1835.  
  1836. file("DAT\ITEMS\" & MapName).write(MapFile)
  1837.  
  1838.  
  1839. "DeathMapGo":
  1840. --3g------------------------------------
  1841. -- Capture Death for CTF event
  1842. ----------------------------------------
  1843. set BlueTeam = file("DAT\CTF\BlueTeam.txt").read
  1844. set RedTeam = file("DAT\CTF\RedTeam.txt").read
  1845. if CTFFlag = 1 then
  1846. if BlueTeam contains ":" & username & ":" or RedTeam contains ":" & username & ":"then
  1847. CTFDeath(movie, me, group, user, fullmsg)
  1848. --DeathMapGo(me, movie, group, username, fullmsg)
  1849. exit
  1850. end if
  1851. end if
  1852.  
  1853. ----------------------------------------
  1854. -- Capture Death for coliseum event
  1855. ----------------------------------------
  1856. set CurrentFighters = file("DAT\Coliseum\CurrentFighters.txt").read
  1857. if ColiseumFlag = 1 and CurrentFighters contains ":" & user.name & ":" then
  1858. ColiseumDeath(UserName, movie)
  1859. exit
  1860. end if
  1861. ----------------------------------------
  1862.  
  1863. put user.name
  1864. DeathMapGo(me, movie, group, user, fullmsg)
  1865.  
  1866. "SaveHouse":
  1867. SaveHouse(me, movie, group, user, fullmsg)
  1868.  
  1869. "SpCmd":
  1870. ShopCommand(me, movie, group, user, fullmsg)
  1871.  
  1872. "MpTlCng":
  1873. MapTileChange(me, movie, group, user, fullmsg)
  1874.  
  1875. "MpT2Cng":
  1876. BuildLand(me, movie, group, user, fullmsg)
  1877.  
  1878. "MpT3Cng":
  1879. BuyLand(me, movie, group, user, fullmsg)
  1880.  
  1881. "SayTreasure":
  1882. SayTreasure(me, movie, group, user, fullmsg)
  1883.  
  1884. "SayFaction":
  1885. SayFaction(me, movie, group, user, fullmsg)
  1886.  
  1887. "PrtlExt":
  1888. Portal(me, movie, group, user, fullmsg)
  1889.  
  1890. "SayQuest":
  1891. SayQuest(me, movie, group, user, fullmsg)
  1892.  
  1893. "treack":
  1894. TreasureCheck(me, movie, group, user, fullmsg)
  1895.  
  1896. "BlkJckExch":
  1897. BlackJackGameOver(me, movie, group, user, fullmsg)
  1898.  
  1899. "STARTASSGAME":
  1900. STARTASSGAME(me, movie, group, user, fullmsg)
  1901.  
  1902. "StartLightningAssGame":
  1903. StartLightningAssGame(me, movie, group, user, fullmsg)
  1904.  
  1905. "ENDASSGAME":
  1906. ENDASSGAME(me, movie, group, user, fullmsg)
  1907.  
  1908. "ASSGAMEADDSCORE":
  1909. --AssGameAddScore(me, movie, group, user, fullmsg)
  1910.  
  1911. "ShowAssScores":
  1912. set FilName = "DAT\SETTINGS\AssassinScore.txt"
  1913. set HighScoreList = file(FilName).read
  1914. User.sendMessage("assscrlstx", HighScoreList, 0, FALSE, username)
  1915.  
  1916. --set FilName = "DAT\SETTINGS\AssassinScore.txt"
  1917. --set HighScoreList = file(FilName).read
  1918. --User.sendMessage("assscrlst", HighScoreList, 0, FALSE, username)
  1919.  
  1920. "Sccr":
  1921. set scre = integer(content)
  1922. set MyName = username
  1923. CheckHighScore(MyName, scre)
  1924.  
  1925. "ShowScores":
  1926. set FilName = "DAT\SETTINGS\highscore.txt"
  1927. set HighScoreList = file(FilName).read
  1928. User.sendMessage("scrlst", HighScoreList, 0, FALSE, username)
  1929.  
  1930. "SltMcn":
  1931. set TheCost = integer(content)
  1932.  
  1933. set MyName = username
  1934. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  1935. set the itemdelimiter = "|"
  1936. set MyGold = integer(item 1 of MyItemsFile)
  1937. set the itemdelimiter = ":"
  1938.  
  1939. if MyGold >= TheCost then
  1940.  
  1941. User.sendMessage("goslt", TheCost, 0, FALSE, username)
  1942. else
  1943. User.sendMessage("noslt", "x", 0, FALSE, username)
  1944. end if
  1945. ----------------- * * *
  1946. "sltwn":
  1947. SlotDone(me, movie, group, user, fullMsg)
  1948.  
  1949. --------------------------------------------------
  1950. "DropAnItem":
  1951.  
  1952. set FileDT = string(content)
  1953. if FileDT contains "battleship" then set ItsAGo = 1
  1954. if FileDT contains "boat" then set ItsAGo = 1
  1955. if FileDT contains "Crystal" then set ItsAGo = 1
  1956. if FileDT contains "logs" then set ItsAGo = 1
  1957. if FileDT contains "exit" then set ItsAGo = 1
  1958. if FileDT contains "mailbox" then set ItsAGo = 1
  1959. if FileDT contains "trout" then set ItsAGo = 1
  1960. if FileDT contains "Shark" then set ItsAGo = 1
  1961. if FileDT contains "Lobster" then set ItsAGo = 1
  1962. if FileDT contains "catfish" then set ItsAGo = 1
  1963. if FileDT contains "squid" then set ItsAGo = 1
  1964. if FileDT contains "swordfish" then set ItsAGo = 1
  1965. if FileDT contains "fish" then set ItsAGo = 1
  1966. if FileDT contains "Head" then set ItsAGo = 1
  1967. if FileDT contains "Street" then set ItsAGo = 1
  1968. if FileDT contains "Corn" then set ItsAGo = 1
  1969. if FileDT contains "Nectar" then set ItsAGo = 1
  1970. if FileDT contains "Watermelon" then set ItsAGo = 1
  1971. if FileDT contains "Flowers" then set ItsAGo = 1
  1972. if FileDT contains "Roses" then set ItsAGo = 1
  1973. if FileDT contains "Chunk" then set ItsAGo = 1
  1974. if FileDT contains "Airship" then set ItsAGo = 1
  1975. if FileDT contains "CTF Flag" then ItsAGo = 1
  1976.  
  1977. if ItsAGo <> 1 then exit
  1978.  
  1979. set the itemdelimiter = "`"
  1980. set FilName = item 1 of FileDT
  1981. set NewItem = item 2 of FileDT
  1982. set ItDt = item 2 of FileDT
  1983. set ItemList = file("DAT\ITEMS\" & FilName).read
  1984. set the ItemDelimiter = "|"
  1985. if item 20 of ItemList = "" then set OneToPlace = 20
  1986. if item 19 of ItemList = "" then set OneToPlace = 19
  1987. if item 18 of ItemList = "" then set OneToPlace = 18
  1988. if item 17 of ItemList = "" then set OneToPlace = 17
  1989. if item 16 of ItemList = "" then set OneToPlace = 16
  1990. if item 15 of ItemList = "" then set OneToPlace = 15
  1991. if item 14 of ItemList = "" then set OneToPlace = 14
  1992. if item 13 of ItemList = "" then set OneToPlace = 13
  1993. if item 12 of ItemList = "" then set OneToPlace = 12
  1994. if item 11 of ItemList = "" then set OneToPlace = 11
  1995. if item 10 of ItemList = "" then set OneToPlace = 10
  1996. if item 9 of ItemList = "" then set OneToPlace = 9
  1997. if item 8 of ItemList = "" then set OneToPlace = 8
  1998. if item 7 of ItemList = "" then set OneToPlace = 7
  1999. if item 6 of ItemList = "" then set OneToPlace = 6
  2000. if item 5 of ItemList = "" then set OneToPlace = 5
  2001. if item 4 of ItemList = "" then set OneToPlace = 4
  2002. if item 3 of ItemList = "" then set OneToPlace = 3
  2003. if item 2 of ItemList = "" then set OneToPlace = 2
  2004. if item 1 of ItemList = "" then set OneToPlace = 1
  2005.  
  2006. set the itemdelimiter = ":"
  2007. set stuffin = item 1 of ItDt & ":" & item 2 of ItDt
  2008. set the ItemDelimiter = "|"
  2009. put stuffin into item OnetoPlace of ItemList
  2010.  
  2011. if ItemList contains "|" then
  2012. else
  2013. exit
  2014. end if
  2015.  
  2016. file("DAT\ITEMS\" & FilName).write(ItemList)
  2017.  
  2018. --------------------------------------------------
  2019. "AdminItemDrop":
  2020. if (getUserRank(username) = "Player") or (getUserRank(username) = "Moderator") then exit
  2021. set FileDT = string(content)
  2022. set the itemdelimiter = "`"
  2023. set FilName = item 1 of FileDT
  2024. set NewItem = item 2 of FileDT
  2025. set ItDt = item 2 of FileDT
  2026. set ItemList = file("DAT\ITEMS\" & FilName).read
  2027. set the ItemDelimiter = "|"
  2028. if item 20 of ItemList = "" then set OneToPlace = 20
  2029. if item 19 of ItemList = "" then set OneToPlace = 19
  2030. if item 18 of ItemList = "" then set OneToPlace = 18
  2031. if item 17 of ItemList = "" then set OneToPlace = 17
  2032. if item 16 of ItemList = "" then set OneToPlace = 16
  2033. if item 15 of ItemList = "" then set OneToPlace = 15
  2034. if item 14 of ItemList = "" then set OneToPlace = 14
  2035. if item 13 of ItemList = "" then set OneToPlace = 13
  2036. if item 12 of ItemList = "" then set OneToPlace = 12
  2037. if item 11 of ItemList = "" then set OneToPlace = 11
  2038. if item 10 of ItemList = "" then set OneToPlace = 10
  2039. if item 9 of ItemList = "" then set OneToPlace = 9
  2040. if item 8 of ItemList = "" then set OneToPlace = 8
  2041. if item 7 of ItemList = "" then set OneToPlace = 7
  2042. if item 6 of ItemList = "" then set OneToPlace = 6
  2043. if item 5 of ItemList = "" then set OneToPlace = 5
  2044. if item 4 of ItemList = "" then set OneToPlace = 4
  2045. if item 3 of ItemList = "" then set OneToPlace = 3
  2046. if item 2 of ItemList = "" then set OneToPlace = 2
  2047. if item 1 of ItemList = "" then set OneToPlace = 1
  2048. set the itemdelimiter = ":"
  2049. set stuffin = item 1 of ItDt & ":" & item 2 of ItDt
  2050. set the ItemDelimiter = "|"
  2051. put stuffin into item OnetoPlace of ItemList
  2052.  
  2053. if ItemList contains "|" then
  2054. else
  2055. exit
  2056. end if
  2057.  
  2058. -----
  2059. the ItemDelimiter = ":"
  2060. Itemm = NewItem.item[1]
  2061. the itemdelimiter = "i"
  2062. DropDB = fread("Database\GameDB\AdminDrops.dat", #Value)
  2063. if DropDB = VOID then DropDB = [:]
  2064. dropDat = "dropped " & Itemm & " on map " & FilName.item[1] & " on " & The Short Date & " at " & The Short Time & "." -- These Users were on this map:" & TheGroup
  2065. DropDB.addProp(symbol(username), DropDat)
  2066. fwrite("Database\GameDB\AdminDrops.dat", DropDB, #Value)
  2067. --put DropDB
  2068.  
  2069. file("DAT\ITEMS\" & FilName).write(ItemList)
  2070.  
  2071.  
  2072. ----------------------------------------------------------------------------------
  2073. "GrabItems":
  2074. GrabItems(me, movie, group, user, fullmsg)
  2075.  
  2076. --------------------------------------------------
  2077. "LoadMail":
  2078. set FilName = "DAT\MAIL\" & content
  2079. set MyFile = file(FilName).read
  2080. User.sendMessage("MailList", MyFile, 0, FALSE, username)
  2081.  
  2082. "SendMail":
  2083. set FileDT = string(content)
  2084. set the itemdelimiter = "`"
  2085. set FilName = item 1 of FileDT
  2086. set MyMessage = item 2 of FileDT
  2087. set CurMail = "DAT\MAIL\" & FilName
  2088. set CurMail = file(CurMail).read
  2089. set CurMail = CurMail & MyMessage
  2090. file("DAT\MAIL\" & FilName).write(CurMail)
  2091.  
  2092. "SaveMail":
  2093. set FileDT = string(content)
  2094. set the itemdelimiter = "`"
  2095. set FilName = item 1 of FileDT
  2096. set FilDat = item 2 of FileDT
  2097. file("DAT\MAIL\" & FilName).write(FilDat)
  2098.  
  2099. "SortIP":
  2100. MyIPP = content
  2101. set FilName = "DAT\SETTINGS\bans.txt"
  2102. set MyFile = file(FilName).read
  2103. if MyFile contains MyIPP then User.sendMessage("927417351", "x", 0, FALSE, username)
  2104.  
  2105. "AddBan":
  2106. set IPtoBan = string(content)
  2107. set FilName = "DAT\SETTINGS\bans.txt"
  2108. set BannedIPs = file(FilName).read
  2109. set BannedIPs = BannedIPs & "*" & IPtoBan & "*"
  2110. file("DAT\SETTINGS\bans.txt").write(BannedIPs)
  2111.  
  2112. "RemoveBan":
  2113. set IPtoRemove = string(content)
  2114. set FilName = "DAT\SETTINGS\bans.txt"
  2115. set BannedIPs = file(FilName).read
  2116. set the itemdelimiter = "*"
  2117. repeat with x = 1 to 500
  2118. if item x of BannedIPs = IPtoRemove then put "" into item x of BannedIPs
  2119. end repeat
  2120. file("DAT\SETTINGS\bans.txt").write(BannedIPs)
  2121.  
  2122. "LoadMap":
  2123. if (content = "xReySpawn.txt") then
  2124. warp = fread("DAT\DM\" & username & ".txt", #text)
  2125. sendpacket(username, "Warp", "!!! !!! " & Warp)
  2126. end if
  2127.  
  2128.  
  2129. set TheName = content
  2130. the itemdelimiter = "."
  2131. MapName = TheName.item[1]
  2132. set FilName = "DAT\MAPS\"
  2133. FilName = FilName & content
  2134. set MyFile = file(FilName).read
  2135. set FilxName = "DAT\MOBS\"
  2136. FilxName = FilxName & content
  2137. set MyxFile = file(FilxName).read
  2138. set the itemdelimiter = "."
  2139. set Mapp = item 1 of TheName & "i.txt"
  2140. set FilName = "DAT\ITEMS\"
  2141. FilName = FilName & Mapp
  2142. set ItemFile = file(FilName).read
  2143. set TheFiles = MyFile & "^" & ItemFile & "^" & MyxFile & "^"
  2144. SendNPCs (MyxFile, me, movie, group, user, fullMsg, TheFiles)
  2145. -----
  2146. CurMap = fread("Database\GameDB\CurrentMap.dat", #value)
  2147. if CurMap = VOID then CurMap = [:]
  2148. if (CurMap.GetAProp(Symbol(username)) = VOID) then
  2149. nothing
  2150. else
  2151. CurMap.DeleteProp(Symbol(UserName))
  2152. end if
  2153. CurMap.addProp(symbol(username), string(MapName))
  2154. --put CurMap
  2155. fwrite("Database\GameDB\currentmap.dat", CurMap, #value)
  2156.  
  2157. "LoadItems":
  2158. set FilName = "DAT\ITEMS\"
  2159. FilName = FilName & content
  2160. set MyFile = file(FilName).read
  2161. User.sendMessage("GetItems", MyFile, 0, FALSE, username)
  2162.  
  2163. "LoadItemsW":
  2164. set FilName = "DAT\ITEMS\"
  2165. FilName = FilName & content
  2166. set MyFile = file(FilName).read
  2167. User.sendMessage("GetItemsW", MyFile, 0, FALSE, username)
  2168.  
  2169. "LoadBoard1":
  2170. set FilName = "DAT\BOARDS\"
  2171. FilName = FilName & content
  2172. set MyFile = file(FilName).read
  2173. User.sendMessage("GetBoards", MyFile, 0, FALSE, username)
  2174.  
  2175. "LoadMapX":
  2176. set FilName = "DAT\MAPS\"
  2177. FilName = FilName & content
  2178. set MyFile = file(FilName).read
  2179. User.sendMessage("GetMapX", MyFile, 0, FALSE, username)
  2180.  
  2181. "LoadMobsX":
  2182. set FilName = "DAT\MOBS\"
  2183. FilName = FilName & content
  2184. set MyFile = file(FilName).read
  2185. User.sendMessage("GetMobsX", MyFile, 0, FALSE, username)
  2186.  
  2187. "LoadItemsX":
  2188. set FilName = "DAT\ITEMS\"
  2189. FilName = FilName & content
  2190. set MyFile = file(FilName).read
  2191. User.sendMessage("GetItemsX", MyFile, 0, FALSE, username)
  2192. --------------------------------------------------
  2193. "SaveMap":
  2194. set FileDT = string(content)
  2195. set the itemdelimiter = "`"
  2196. set FilName = item 1 of FileDT
  2197. set FilDat = item 2 of FileDT
  2198. file("DAT\MAPS\" & FilName).write(FilDat)
  2199. User.sendMessage("MapIsCreated", "x", 0, FALSE, username)
  2200. --------------------------------------------------
  2201.  
  2202. "SveMb":
  2203. set FileDT = string(content)
  2204. set the itemdelimiter = "`"
  2205. set FilName = item 1 of FileDT
  2206. set FilDat = item 2 of FileDT
  2207. file("DAT\MOBS\" & FilName).write(FilDat)
  2208.  
  2209. -------------------------------------------------- ***** VAULT!!!!!
  2210. "DropInVault":
  2211. set FileDT = string(content)
  2212. set MyName = username
  2213. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  2214. set the itemdelimiter = "|"
  2215. set MyInv = item 2 of MyItemsFile
  2216.  
  2217. set the itemdelimiter = "`"
  2218. set VaultName = item 1 of FileDT
  2219. set ItemToAdd = item 2 of FileDT
  2220. set InvenNum = integer(item 3 of FileDT)
  2221. set the itemdelimiter = ":"
  2222.  
  2223. set VaultIsFull = FALSE
  2224.  
  2225. set FilName = "DAT\VAULTS\" & VaultName
  2226. set VaultInfo = file(FilName).read
  2227. if VaultInfo = VOID then set VaultInfo = ""
  2228.  
  2229. set MaxAmnt = 15
  2230. if VaultName contains "Crate" then set MaxAmnt = 3
  2231. if VaultName contains "Vault" then set MaxAmnt = 15
  2232. if VaultName contains "Chest" then set MaxAmnt = 15
  2233. if VaultName contains "Cabinet" then set MaxAmnt = 10
  2234. if VaultName contains "Wind Cabinet" then set MaxAmnt = 20
  2235. if VaultName contains "Item Bag" then set MaxAmnt = 60
  2236. if VaultName contains "TempChest" then MaxAmnt = VaultInfo.line.count + 1
  2237.  
  2238. if line MaxAmnt of VaultInfo <> "" then set VaultIsFull = TRUE
  2239.  
  2240. if VaultIsFull = TRUE then
  2241. User.sendMessage("sqa", "This is too full to store anything else!", 0, FALSE, username)
  2242. exit
  2243. end if
  2244.  
  2245. if item InvenNum of MyInv contains ItemToAdd & "-" then
  2246. set ItsAGo = 1
  2247. end if
  2248.  
  2249. if ItsAGo <> 1 then exit
  2250.  
  2251. set nItem = ItemToAdd
  2252. set ItemNum = 1
  2253. InvDel(MyName, MyItemsFile, nItem, ItemNum, user, fullmsg, group, movie)
  2254.  
  2255. set VaultInfo = VaultInfo & ItemToAdd & RETURN
  2256. if VaultInfo contains "|" then exit
  2257. if not(VaultName = "Trash Can.txt") then file("DAT\VAULTS\" & VaultName).write(VaultInfo)
  2258.  
  2259. --if VaultName contains "Cauldron" then
  2260. --DidWeBooyaSomeWitchcraft(MyName, user, fullmsg, group, movie, VaultName, VaultInfo)
  2261. --end if
  2262.  
  2263. "GetChest":
  2264. set FiletoGet = string(content)
  2265. set FilName = "DAT\VAULTS\" & FiletoGet
  2266. set VaultInfo = file(FilName).read
  2267. User.sendMessage("VaultReturned", VaultInfo, 0, FALSE, username)
  2268.  
  2269. "GetBalance":
  2270. set FiletoGet = string(content)
  2271. set FilName = "DAT\BANK\" & FiletoGet
  2272. set Bankk = file(FilName).read
  2273. if Bankk = "" then set Bankk = "0"
  2274. if Bankk = VOID then set Bankk = "0"
  2275. file("DAT\BANK\" & FiletoGet).write(Bankk)
  2276. User.sendMessage("BalanceReturned", Bankk, 0, FALSE, username)
  2277.  
  2278. "Deposit":
  2279. set FileDT = string(content)
  2280.  
  2281. set MyName = username
  2282. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  2283. set the itemdelimiter = "|"
  2284. set MyGold = integer(item 1 of MyItemsFile)
  2285.  
  2286. set the itemdelimiter = "`"
  2287. set BankName = item 1 of FileDT
  2288. set DepAmount = integer(item 2 of FileDT)
  2289. set FilName = "DAT\BANK\" & BankName
  2290. set Bankk = file(FilName).read
  2291. set nBankk = integer(Bankk) + DepAmount
  2292. set MyGold = MyGold - DepAmount
  2293.  
  2294. if MyGold < 0 then
  2295. exit
  2296. end if
  2297.  
  2298. set the itemdelimiter = "|"
  2299. put MyGold into item 1 of MyItemsFile
  2300. file("Database\Characters\" & string(MyName & "-i") & ".txt").write(MyItemsFile)
  2301.  
  2302. file("DAT\BANK\" & BankName).write(String(nBankk))
  2303. User.sendMessage("DepositDone", nBankk, 0, FALSE, username)
  2304. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  2305.  
  2306. "Withdraw":
  2307. set FileDT = string(content)
  2308.  
  2309. set MyName = username
  2310. set OtherName = string(fullmsg.SenderID)
  2311. if OtherName <> MyName then exit
  2312.  
  2313. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  2314. set the itemdelimiter = "|"
  2315. set MyGold = integer(item 1 of MyItemsFile)
  2316.  
  2317. set the itemdelimiter = "`"
  2318. set BankName = item 1 of FileDT
  2319. set DepAmount = integer(item 2 of FileDT)
  2320. set FilName = "DAT\BANK\" & BankName
  2321. set Bankk = file(FilName).read
  2322. set nBankk = integer(Bankk) - DepAmount
  2323. set MyGold = MyGold + DepAmount
  2324.  
  2325. if nBankk < 0 then
  2326. exit
  2327. end if
  2328.  
  2329. set the itemdelimiter = "|"
  2330. put MyGold into item 1 of MyItemsFile
  2331. file("Database\Characters\" & string(MyName & "-i") & ".txt").write(MyItemsFile)
  2332.  
  2333. file("DAT\BANK\" & BankName).write(String(nBankk))
  2334. User.sendMessage("DepositDone", nBankk, 0, FALSE, username)
  2335. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  2336.  
  2337. "itremovv":
  2338. set ItemToAdd = string(content)
  2339. set CanIGoOK = FALSE
  2340. if ItemToAdd contains "Crate" then set CanIGoOK = TRUE
  2341. if ItemToAdd contains "Cabinet" then set CanIGoOK = TRUE
  2342. if ItemToAdd contains "Potion" then set CanIGoOK = TRUE
  2343. if ItemToAdd = "Apple" then set CanIGoOK = TRUE
  2344. if ItemToAdd = "Pie" then set CanIGoOK = TRUE
  2345. if ItemToAdd = "Corn" then set CanIGoOK = TRUE
  2346. if ItemToAdd = "Fish" then set CanIGoOK = TRUE
  2347. if ItemToAdd = "Lobster" then set CanIGoOK = TRUE
  2348. if ItemToAdd = "Shark" then set CanIGoOK = TRUE
  2349. if ItemToAdd = "Ale" then set CanIGoOK = TRUE
  2350. if ItemToAdd = "Pig" then set CanIGoOK = TRUE
  2351. if ItemToAdd = "Chair" then set CanIGoOK = TRUE
  2352. if ItemToAdd = "Table" then set CanIGoOK = TRUE
  2353. if ItemToAdd = "Stool" then set CanIGoOK = TRUE
  2354. if CanIGoOK = FALSE then exit
  2355. set FileDT = string(content)
  2356. set MyName = username
  2357. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  2358. set the itemdelimiter = "|"
  2359. set MyInv = item 2 of MyItemsFile
  2360.  
  2361. if ItemToAdd contains " Crystals" then
  2362. set the itemdelimiter = " "
  2363. set ItemNum = integer(item 1 of ItemToAdd)
  2364. set ItemToAdd = item 2 of ItemToAdd & " " & item 3 of ItemToAdd
  2365. end if
  2366.  
  2367. set the itemdelimiter = ":"
  2368.  
  2369. repeat with xxx = 1 to 15
  2370. if item xxx of MyInv = "" then set ItsAGo = 1
  2371. end repeat
  2372.  
  2373. if MyInv contains ItemToAdd & "-" then set ItsAGo = 1
  2374.  
  2375. if ItsAGo = 0 then exit
  2376. set ItemNum = 1
  2377.  
  2378. set nItem = ItemToAdd
  2379. InvAdd(MyName, MyItemsFile, nItem, ItemNum, user, fullmsg, group, movie)
  2380.  
  2381. "GetFromVault":
  2382. set FileDT = string(content)
  2383. the itemdelimiter = ";"
  2384. FileDT = FileDT.item[2]
  2385. set the itemdelimiter = "`"
  2386. set VaultName = item 1 of FileDT
  2387. set ItemToAdd = item 2 of FileDT
  2388. set FilName = "DAT\VAULTS\" & VaultName
  2389. set VaultInfo = file(FilName).read
  2390.  
  2391. set the itemdelimiter = RETURN
  2392. set NewVault = ""
  2393.  
  2394. repeat with x = 1 to 200
  2395. if item x of VaultInfo <> "" then set NewVault = NewVault & item x of VaultInfo & RETURN
  2396. end repeat
  2397.  
  2398. repeat with x = 1 to 200
  2399. if line x of NewVault = ItemToAdd then
  2400. ----------------------
  2401. set FileDT = string(content)
  2402. set MyName = username
  2403. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  2404. set the itemdelimiter = "|"
  2405. set MyInv = item 2 of MyItemsFile
  2406.  
  2407. if ItemToAdd contains " Crystals" then
  2408. set the itemdelimiter = " "
  2409. set ItemNum = integer(item 1 of ItemName)
  2410. set ItemToAdd = item 2 of ItemToAdd & " " & item 3 of ItemToAdd
  2411. end if
  2412.  
  2413. set the itemdelimiter = ":"
  2414.  
  2415. repeat with xxx = 1 to 15
  2416. if item xxx of MyInv = "" then set ItsAGo = 1
  2417. end repeat
  2418.  
  2419. if MyInv contains ItemToAdd & "-" then set ItsAGo = 1
  2420.  
  2421. if ItsAGo = 0 then exit
  2422. set ItemNum = 1
  2423.  
  2424. set nItem = ItemToAdd
  2425. InvAdd(MyName, MyItemsFile, nItem, ItemNum, user, fullmsg, group, movie)
  2426.  
  2427. ----------------------
  2428. delete line x of NewVault
  2429. set ItemExists = 1
  2430. exit repeat
  2431. end if
  2432. end repeat
  2433.  
  2434. if NewVault contains "|" then exit
  2435. file("DAT\VAULTS\" & VaultName).write(NewVault)
  2436.  
  2437. "SaveBoard1":
  2438. set FileDT = string(content)
  2439. set the itemdelimiter = "`"
  2440. set FilName = item 1 of FileDT
  2441. set FilDat = item 2 of FileDT
  2442. file("DAT\BOARDS\" & FilName).write(FilDat)
  2443.  
  2444. "LoadNews":
  2445. set FilName = "DAT\SETTINGS\News.txt"
  2446. set MyFile = file(FilName).read
  2447. User.sendMessage("News", MyFile, 0, FALSE, username)
  2448.  
  2449. "LoadQuests":
  2450. set FilName = "DAT\SETTINGS\CurQuest.txt"
  2451. set MyFile = file(FilName).read
  2452. User.sendMessage("Quests", MyFile, 0, FALSE, username)
  2453.  
  2454. "QuestComplete":
  2455. set FileDT = string(content)
  2456. file("DAT\SETTINGS\CurQuest.txt").write(FileDT)
  2457.  
  2458. "LoadTheNPC":
  2459. set CharName = string(content)
  2460. set FilName = "DAT\NPC\" & CharName & ".txt"
  2461. set MyFile = file(FilName).read
  2462. User.sendMessage("NPCLoaded", MyFile, 0, FALSE, username)
  2463.  
  2464. "LoadSystem":
  2465. set FilName = "DAT\SETTINGS\System.txt"
  2466. set MyFile = file(FilName).read
  2467. User.sendMessage("LoadSystem", MyFile, 0, FALSE, username)
  2468.  
  2469. "LoadNPCSellList":
  2470. set CharName = string(content)
  2471. set FilName = "DAT\NPC\" & CharName
  2472. set LList = file(FilName).read
  2473. set BuyItems = ""
  2474. set BuyItemPrices = ""
  2475.  
  2476. repeat with x = 1 to 30
  2477. if line x of LList contains "SEL|" then
  2478. set the itemdelimiter = "|"
  2479. set TheGoods = item 2 of line x of LList
  2480. set the itemdelimiter = ":"
  2481. set ItemName = item 1 of TheGoods
  2482. set ItemPrice = item 2 of TheGoods
  2483. set BuyItems = BuyItems & ItemName & RETURN
  2484. set BuyItemPrices = BuyItemPrices & ItemPrice & RETURN
  2485. end if
  2486. end repeat
  2487. set TheList = BuyItems & ":" & BuyItemPrices
  2488. User.sendMessage("NPCSellList", TheList, 0, FALSE, username)
  2489. ---------------------------------------------------------------------------------------------------
  2490. "LoadNPCBuyList":
  2491. set CharName = string(content)
  2492. set FilName = "DAT\NPC\" & CharName
  2493. set LList = file(FilName).read
  2494. set BuyItems = ""
  2495. set BuyItemPrices = ""
  2496.  
  2497. repeat with x = 1 to 60
  2498. if line x of LList contains "BUY|" then
  2499. set the itemdelimiter = "|"
  2500. set TheGoods = item 2 of line x of LList
  2501. set the itemdelimiter = ":"
  2502. set ItemName = item 1 of TheGoods
  2503. set ItemPrice = item 2 of TheGoods
  2504. set BuyItems = BuyItems & ItemName & RETURN
  2505. set BuyItemPrices = BuyItemPrices & ItemPrice & RETURN
  2506. end if
  2507. end repeat
  2508. set TheList = BuyItems & ":" & BuyItemPrices
  2509. User.sendMessage("NPCBuyList", TheList, 0, FALSE, username)
  2510. ---------------------------------------------------------------------------------------------------
  2511. "ReduceGoldFromSpell":
  2512. set MyName = username
  2513. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  2514. set the itemdelimiter = "|"
  2515. set myCharGold = integer(item 1 of MyitemsFile)
  2516. set MycharGold = MyCharGold - integer(content)
  2517. if MyCharGold < 0 then exit
  2518. if string(MyCharGold) contains "-" then exit
  2519. put MycharGold into item 1 of MyItemsFile
  2520. file("Database\Characters\" & string(MyName & "-i") & ".txt").write(MyItemsFile)
  2521. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  2522.  
  2523.  
  2524. "GiveGoldToNPC":
  2525.  
  2526. set MyName = username
  2527. set MyItemsFile = file("Database\Characters\" & string(MyName) & "-i.txt").read
  2528.  
  2529. set NPCDat = string(content)
  2530. set the itemdelimiter = ":"
  2531. set NPCName = item 1 of NPCDat
  2532. set NewGold = integer(item 2 of NPCDat)
  2533. set the itemdelimiter = "."
  2534. set FNPCxName = item 1 of NPCName
  2535. set NPCTalkDAt = FNPCxName & " says " & QUOTE & "Thanks for the gold!"
  2536. set the itemdelimiter = "|"
  2537. set myCharGold = integer(item 1 of MyitemsFile)
  2538. set MycharGold = MyCharGold - integer(NewGold)
  2539. if MyCharGold < 0 then exit
  2540. put MycharGold into item 1 of MyItemsFile
  2541. file("Database\Characters\" & string(MyName & "-i") & ".txt").write(MyItemsFile)
  2542. User.sendMessage("inx", MyItemsFile, 0, FALSE, username)
  2543. User.sendMessage("sqa", NPCTalkDAt, 0, FALSE, username)
  2544.  
  2545. set FilName = "DAT\NPC\" & NPCName
  2546. set LList = file(FilName).read
  2547.  
  2548. repeat with x = 1 to 60
  2549. if line x of LList contains "GLD|" then
  2550. set the itemdelimiter = "|"
  2551. set MyGold = integer(item 2 of line x of LList)
  2552. set GoldtoAdd = MyGold + NewGold
  2553. set GoldToAdd = "GLD|" & string(GoldToAdd)
  2554. put GoldToAdd into line x of LList
  2555. end if
  2556. end repeat
  2557.  
  2558. file("DAT\NPC\" & NPCName).write(LList)
  2559.  
  2560. "BuyFromNPC":
  2561. NPCBuy(me, movie, group, user, fullmsg)
  2562.  
  2563.  
  2564. "SellToNPC":
  2565. NPCSell(me, movie, group, user, fullmsg)
  2566.  
  2567.  
  2568. "Mkilldrp":
  2569.  
  2570. set FileDT = string(content)
  2571. set the itemdelimiter = "`"
  2572. set FilName = item 1 of FileDT
  2573. set NPCname = item 2 of FileDT
  2574. set ItemDat = item 3 of FileDT
  2575.  
  2576. set NPCFilName = "DAT\NPC\" & NPCname
  2577. set NPCFile = file(NPCFilName).read
  2578. if NPCFile = VOID then exit
  2579.  
  2580. set CurInvLst = ""
  2581. set InvAmnt = 0
  2582.  
  2583. repeat with x = 1 to 80
  2584. if line x of NPCFile contains "INV|" then
  2585. set the itemdelimiter = "|"
  2586. set TheGoods = item 2 of line x of NPCFile
  2587. set CurInvLst = CurInvLst & TheGoods & RETURN
  2588. set InvAmnt = InvAmnt + 1
  2589. end if
  2590. end repeat
  2591.  
  2592. if InvAmnt = 0 then exit
  2593. set WhichOneLine = random(InvAmnt)
  2594.  
  2595. set CurItttm = line WhichOneLine of CurInvLst
  2596. set the itemdelimiter = ":"
  2597. set RndAmnt = integer(item 2 of CurItttm)
  2598. set DoWeDrop = random(RndAmnt)
  2599. if DoWeDrop <> 1 then exit
  2600. set TheItemm = item 1 of CurItttm
  2601.  
  2602. set ItemList = file("DAT\ITEMS\" & FilName).read
  2603. set the ItemDelimiter = "|"
  2604. set OneToPlace = 0
  2605. if item 8 of ItemList = "" then set OneToPlace = 8
  2606. if item 7 of ItemList = "" then set OneToPlace = 7
  2607. if item 6 of ItemList = "" then set OneToPlace = 6
  2608. if item 5 of ItemList = "" then set OneToPlace = 5
  2609. if item 4 of ItemList = "" then set OneToPlace = 4
  2610. if item 3 of ItemList = "" then set OneToPlace = 3
  2611. if item 2 of ItemList = "" then set OneToPlace = 2
  2612. if item 1 of ItemList = "" then set OneToPlace = 1
  2613. if OneToPlace = 0 then exit
  2614. set the itemdelimiter = ":"
  2615. set TheItemDrp = TheItemm & ":" & ItemDat
  2616. set the ItemDelimiter = "|"
  2617. put TheItemDrp into item OnetoPlace of ItemList
  2618.  
  2619. if ItemList contains "|" then
  2620. else
  2621. exit
  2622. end if
  2623.  
  2624. file("DAT\ITEMS\" & FilName).write(ItemList)
  2625.  
  2626. User.sendMessage("drelxu", TheItemDrp, 0, FALSE, username)
  2627.  
  2628. end case
  2629.  
  2630. end
Add Comment
Please, Sign In to add comment