Sub make_chestini(index)On Error Resume nextDim chest__numDim chest__numbDim new_chest_maxDim make_amount_chestschest__num = GetVar("Chests.ini " , "DATA" , "Amountmade")make_amount_chests = Int(GetVar("Chests.ini " , "DATA" , "makeamount"))If chest__num = 0 Thenchest__num = 1Call PutVar("Chests.ini " , "DATA" , "Editingchestnum", Int(0))Call PutVar("Chests.ini " , "DATA" , "whatedited", Int(0))Do While chest__num <= make_amount_chestsCall PutVar("Chests.ini " , "CHEST" & chest__num , "stackable", "")Call PutVar("Chests.ini " , "CHEST" & chest__num , "itemnum", "")Call PutVar("Chests.ini " , "CHEST" & chest__num , "itemamount", "")Call PutVar("Chests.ini " , "CHEST" & chest__num , "message", "")chest__num = chest__num+1LOOPCall PutVar("Chests.ini " , "DATA" , "Amountmade", Int(make_amount_chests))ElseIf chest__num > 0 Thennew_chest_max = chest__num+make_amount_chestschest__num = chest__num+1Do While chest__num <= new_chest_maxCall PutVar("Chests.ini " , "CHEST" & chest__num , "stackable", "")Call PutVar("Chests.ini " , "CHEST" & chest__num , "itemnum", "")Call PutVar("Chests.ini " , "CHEST" & chest__num , "itemamount", "")chest__num = chest__num+1LOOPCall PutVar("Chests.ini " , "DATA" , "Amountmade", Int(new_chest_max))End IfEnd Sub'******************************************Sub chest_1_sub(index)' *'By Brutal(with a little of barons script)*'******************************************On Error Resume nextDim chest_numDim done_chest_checkDim item_numDim item_amountDim stackableaIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST1","has_data")) < 0 ThenCall Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST1","number", 0)Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST1","has_data", 1)Call Playermsg(index, "Made Chest1 template for map", 14)Call Playermsg(index, "Credits go to Brutal & Baron(mostly Baron on the template makeing part :P) - http://barony.deviantart.com/", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST1","has_data")) = 1 ThenCall Playermsg(index, "You Must First Type /mapchest1 on this map and follow instructions to use this chest", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST1","has_data")) = 2 Thenchest_num = Getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST1","number")done_chest_check = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num)item_num = Int(GetVar("Chests.ini " , "CHEST" & chest_num , "itemnum"))item_amount = Int(GetVar("Chests.ini " , "CHEST" & chest_num , "itemamount"))stackablea = GetVar("Chests.ini " , "CHEST" & chest_num , "stackable")chest_1_message = GetVar("Chests.ini " , "CHEST" & chest_num , "message") If done_chest_check = 0 Then Call PlayerMsg(index, chest_1_message, 2) Call GiveItemb(index, item_num, item_amount, stackablea) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num , 1) ElseIf done_chest_check = 1 Then Call PlayerMsg(index, "Its Empty.", 2) End IfEnd IfEnd Sub'******************************************Sub chest_2_sub(index)' *'By Brutal(with a little of barons script)*'******************************************On Error Resume nextDim chest_num2Dim done_chest_check2Dim item_num2Dim item_amount2Dim stackablea2If Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST2","has_data")) < 0 ThenCall Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST2","number", 0)Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST2","has_data", 1)Call Playermsg(index, "Made Chest2 template for map", 14)Call Playermsg(index, "Credits go to Brutal & Baron(mostly Baron on the template makeing part :P) - http://barony.deviantart.com/", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST2","has_data")) = 1 ThenCall Playermsg(index, "You Must First Type /mapchest2 on this map and follow instructions to use this chest", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST2","has_data")) = 2 Thenchest_num2 = Getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST2","number")done_chest_check2 = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num2)item_num2 = Int(GetVar("Chests.ini " , "CHEST" & chest_num2 , "itemnum"))item_amount2 = Int(GetVar("Chests.ini " , "CHEST" & chest_num2 , "itemamount"))stackablea2 = GetVar("Chests.ini " , "CHEST" & chest_num2 , "stackable")chest_2_message = GetVar("Chests.ini " , "CHEST" & chest_num2 , "message") If done_chest_check2 = 0 Then Call PlayerMsg(index, chest_2_message, 2) Call GiveItemb(index, item_num2, item_amount2, stackablea2) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num2 , 1) ElseIf done_chest_check2 = 1 Then Call PlayerMsg(index, "Its Empty.", 2) End IfEnd IfEnd Sub'******************************************Sub chest_3_sub(index)' *'By Brutal(with a little of barons script)*'******************************************On Error Resume nextDim chest_num3Dim done_chest_check3Dim item_num3Dim item_amount3Dim stackablea3If Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST3","has_data")) < 0 ThenCall Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST3","number", 0)Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST3","has_data", 1)Call Playermsg(index, "Made Chest3 template for map", 14)Call Playermsg(index, "Credits go to Brutal & Baron(mostly Baron on the template makeing part :P) - http://barony.deviantart.com/", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST3","has_data")) = 1 ThenCall Playermsg(index, "You Must First Type /mapchest3 on this map and follow instructions to use this chest", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST3","has_data")) = 2 Thenchest_num3 = Getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST3","number")done_chest_check3 = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num3)item_num3 = Int(GetVar("Chests.ini " , "CHEST" & chest_num3 , "itemnum"))item_amount3 = Int(GetVar("Chests.ini " , "CHEST" & chest_num3 , "itemamount"))stackablea3 = GetVar("Chests.ini " , "CHEST" & chest_num3 , "stackable")chest_3_message = GetVar("Chests.ini " , "CHEST" & chest_num3 , "message") If done_chest_check3 = 0 Then Call PlayerMsg(index, chest_3_message, 2) Call GiveItemb(index, item_num3, item_amount3, stackablea3) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num3 , 1) ElseIf done_chest_check3 = 1 Then Call PlayerMsg(index, "Its Empty.", 2) End IfEnd IfEnd Sub'******************************************Sub chest_4_sub(index)' *'By Brutal(with a little of barons script)*'******************************************On Error Resume nextDim chest_num4Dim done_chest_check4Dim item_num4Dim item_amount4Dim stackablea4If Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST4","has_data")) < 0 ThenCall Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST4","number", 0)Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST4","has_data", 1)Call Playermsg(index, "Made Chest4 template for map", 14)Call Playermsg(index, "Credits go to Brutal & Baron(mostly Baron on the template makeing part :P) - http://barony.deviantart.com/", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST4","has_data")) = 1 ThenCall Playermsg(index, "You Must First Type /mapchest4 on this map and follow instructions to use this chest", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST4","has_data")) = 2 Thenchest_num4 = Getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST4","number")done_chest_check4 = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num4)item_num4 = Int(GetVar("Chests.ini " , "CHEST" & chest_num4 , "itemnum"))item_amount4 = Int(GetVar("Chests.ini " , "CHEST" & chest_num4 , "itemamount"))stackablea4 = GetVar("Chests.ini " , "CHEST" & chest_num4 , "stackable")chest_4_message = GetVar("Chests.ini " , "CHEST" & chest_num4 , "message") If done_chest_check4 = 0 Then Call PlayerMsg(index, chest_4_message, 2) Call GiveItemb(index, item_num4, item_amount4, stackablea4) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num4 , 1) ElseIf done_chest_check4 = 1 Then Call PlayerMsg(index, "Its Empty.", 2) End IfEnd IfEnd Sub'******************************************Sub chest_5_sub(index)' *'By Brutal(with a little of barons script)*'******************************************On Error Resume nextDim chest_num5Dim done_chest_check5Dim item_num5Dim item_amount5Dim stackablea5If Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST5","has_data")) < 0 ThenCall Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST5","number", 0)Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST5","has_data", 1)Call Playermsg(index, "Made Chest5 template for map", 15)Call Playermsg(index, "Credits go to Brutal & Baron(mostly Baron on the template makeing part :P) - http://barony.deviantart.com/", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST5","has_data")) = 1 ThenCall Playermsg(index, "You Must First Type /mapchest5 on this map and follow instructions to use this chest", 14)ElseIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST5","has_data")) = 2 Thenchest_num5 = Getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST5","number")done_chest_check5 = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num5)item_num5 = Int(GetVar("Chests.ini " , "CHEST" & chest_num5 , "itemnum"))item_amount5 = Int(GetVar("Chests.ini " , "CHEST" & chest_num5 , "itemamount"))stackablea5 = GetVar("Chests.ini " , "CHEST" & chest_num5 , "stackable")chest_5_message = GetVar("Chests.ini " , "CHEST" & chest_num5 , "message") If done_chest_check5 = 0 Then Call PlayerMsg(index, chest_5_message, 2) Call GiveItemb(index, item_num5, item_amount5, stackablea5) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHEST" & GetPlayerCharNum(Index) , "Chest" & chest_num5 , 1) ElseIf done_chest_check5 = 1 Then Call PlayerMsg(index, "Its Empty.", 2) End IfEnd IfEnd SubSub GiveItemb(index, item, value, gjshjr)If gjshjr = 1 Then SLOT = 1 Do While SLOT < 24 If GetPlayerInvItemNum(index, SLOT) = 0 Then Call SetPlayerInvItemNum(index, SLOT, item) Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT)+value) Call SendInventoryUpdate(index, SLOT) SLOT = 24 ElseIf GetPlayerInvItemNum(index, SLOT) = item Then Call SetPlayerInvItemNum(index, SLOT, item) Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT)+value) Call SendInventoryUpdate(index, SLOT) SLOT = 24 End If SLOT = SLOT+1 LoopElseIf gjshjr = 0 Then SLOT = 1 Do While SLOT < 24 If GetPlayerInvItemNum(index, SLOT) = 0 Then Call SetPlayerInvItemNum(index, SLOT, item) Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT)+value) Call SendInventoryUpdate(index, SLOT) SLOT = 24 End If SLOT = SLOT+1 LoopElseCall PlayerMsg(index, "hi", 8)End IfEnd Sub
If LCase(Mid(TextSay, 1, 9)) = "/warpmeto" Then If Len(TextSay) > 10 Then TextSay = Mid(TextSay, 10, Len(TextSay) - 9) ' Prevent hacking If GetPlayerAccess(index) < 2 Then Call PlayerMsg(index, "You need be of a higher access to use this command!", 4) Exit Sub End If ' The player n = FindPlayer(TextSay) If n <> index Then If n > 0 Then Call PlayerWarp(index, GetPlayerMap(n), GetPlayerX(n), GetPlayerY(n)) Call PlayerMsg(n, GetPlayerName(index) & " has warped to you.", 6) Call PlayerMsg(index, "You have been warped to " & GetPlayerName(n) & ".", 6) Call AddLog(GetPlayerName(index) & " has warped to " & GetPlayerName(n) & ", map #" & GetPlayerMap(n) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", 15) End If Else Call PlayerMsg(index, "You cannot warp to yourself!", 15) End If End If Exit Sub End If
If LCase(Mid(TextSay, 1, 9)) = "/mapchest" Then If Len(TextSay) >= 9 ThenIf GetPlayerAccess(index) > 0 Then On Error Resume next Dim edit_chest_num Dim chest_temp chest_temp = Mid(TextSay, 10, Len(TextSay) - 9) edit_chest_num = Getvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHESTDATA","editing") n = Mid(TextSay, 10, Len(TextSay) - 9) If n > 0 Then If edit_chest_num = 0 Then Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHESTDATA","editing", Int(chest_temp)) Call Playermsg(index, "You Will now edit chest" & chest_temp & "'s chest number for this map type /mapchest(chest number you want it to be)", 14) ElseIf edit_chest_num > 0 Then Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST" & edit_chest_num,"number", chest_temp) Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHEST" & edit_chest_num,"has_data", 2) Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "CHESTDATA","editing", 0) Call PlayerMsg(index, "You Edited Chest" & edit_chest_num & "'s number to " & chest_temp, 15) End IfElse Call PlayerMsg(index, "Format:/mapchest~chest number you want to edit on this map(one of the five)(without the ~'s) then follow instructions", 4) End If Else Call PlayerMsg(index, "You Need Higher Access To use this command!", 4)End IfEnd IfExit SubEnd If If LCase(Mid(TextSay, 1, 10)) = "/editchest" Then If Len(TextSay) >= 10 ThenIf GetPlayerAccess(index) > 0 Then Dim uuuuu Dim ecn Dim we ecn = GetVar("Chests.ini", "DATA", "Editingchestnum") we = GetVar("Chests.ini", "DATA", "whatedited") n = Mid(TextSay, 11, Len(TextSay) - 10) If n > 0 Then If ecn = 0 Then Call PutVar("Chests.ini", "DATA", "Editingchestnum", Mid(TextSay, 11, Len(TextSay) - 10)) Call PlayerMsg(index, "Now Type /editchest1 to edit the stackable , /editchest2 to edit the itemnum or /editchest3 to edit the itemamount or /editchest4 to edit the message sent upon chest open", 15) ElseIf ecn > 0 Then ecn = GetVar("Chests.ini", "DATA", "Editingchestnum") If GetVar("Chests.ini", "DATA", "whatedited") = 3 Then Call PutVar("Chests.ini", "CHEST" & ecn, "itemamount", Mid(TextSay, 11, Len(TextSay) - 10)) Call PlayerMsg(index, "You Edited Chest" & ecn & "'s item amount to " & Mid(TextSay, 11, Len(TextSay) - 10), 15) Call PutVar("Chests.ini", "DATA", "Editingchestnum", 0) Call PutVar("Chests.ini", "DATA", "whatedited", 0) ElseIf GetVar("Chests.ini", "DATA", "whatedited") = 2 Then Call PutVar("Chests.ini", "CHEST" & ecn, "itemnum", Mid(TextSay, 11, Len(TextSay) - 10)) Call PlayerMsg(index, "You Edited Chest" & ecn & "'s item number to " & Mid(TextSay, 11, Len(TextSay) - 10), 15) Call PutVar("Chests.ini", "DATA", "Editingchestnum", 0) Call PutVar("Chests.ini", "DATA", "whatedited", 0) ElseIf GetVar("Chests.ini", "DATA", "whatedited") = 1 Then uuuuu = Mid(TextSay, 11, Len(TextSay) - 10) If uuuuu = 1 Then Call PutVar("Chests.ini", "CHEST" & ecn, "stackable", Mid(TextSay, 11, Len(TextSay) - 10)) Call PlayerMsg(index, "You Edited Chest" & ecn & "'s stackable to Yes", 15) Call PutVar("Chests.ini", "DATA", "Editingchestnum", 0) Call PutVar("Chests.ini", "DATA", "whatedited", 0) ElseIf uuuuu = 0 Then Call PutVar("Chests.ini", "CHEST" & ecn, "stackable", Mid(TextSay, 11, Len(TextSay) - 10)) Call PlayerMsg(index, "You Edited Chest" & ecn & "'s stackable to No", 15) Call PutVar("Chests.ini", "DATA", "Editingchestnum", 0) Call PutVar("Chests.ini", "DATA", "whatedited", 0) Else Call PlayerMsg(index, "You Must Enter /editchest0 or /editchest1 in this position", 5) End If ElseIf GetVar("Chests.ini", "DATA", "whatedited") = 0 Then If Mid(TextSay, 11, Len(TextSay) - 10) < 5 Then Call PutVar("Chests.ini", "DATA", "whatedited", Mid(TextSay, 11, Len(TextSay) - 10)) Call PlayerMsg(index, "Now type /editchest ~what you want the value to be(without the ~'s)(stackable: 0=no 1=yes)~", 15) Else Call PlayerMsg(index, "The Options are /editchest1 to edit the stackable , /editchest2 to edit the itemnum or /editchest3 to edit the itemamount /editchest4 to edit the message - You Said /editchest" & Mid(TextSay, 11, Len(TextSay) - 10), 15) End If ElseIf GetVar("Chests.ini", "DATA", "whatedited") = 4 Then Call PutVar("Chests.ini", "CHEST" & ecn, "message", Mid(TextSay, 11, Len(TextSay) - 10)) Call PlayerMsg(index, "You Edited Chest" & ecn & "'s message to " & Mid(TextSay, 11, Len(TextSay) - 10), 15) Call PutVar("Chests.ini", "DATA", "Editingchestnum", 0) Call PutVar("Chests.ini", "DATA", "whatedited", 0) Else Call PlayerMsg(index, "The Options are /editchest1 to edit the stackable , /editchest2 to edit the itemnum or /editchest3 to edit the itemamount /editchest4 to edit the message", 15) End If End IfElse Call PlayerMsg(index, "Format:/editchest~chest number you want to edit(without the ~'s) then follow instructions~", 4) End IfElse Call PlayerMsg(index, "You Need Higher Access To use this command", 4)End IfEnd IfExit SubEnd If If LCase(Mid(TextSay, 1, 9)) = "/chestini" Then If Len(TextSay) >= 9 ThenIf GetPlayerAccess(index) > 0 Then n = Mid(TextSay, 10, Len(TextSay) - 9) If n > 0 Then If n < 101 Then Call PutVar("Chests.ini", "DATA", "makeamount", Mid(TextSay, 10, Len(TextSay) - 9)) n = GetVar("Chests.ini", "DATA", "makeamount") If n < 101 Then Call make_chestini(index) Call PlayerMsg(index, "Done - You made " & n & " to make a grand total of " & Int(GetVar("Chests.ini " , "DATA" , "Amountmade")), 15) Else Call PlayerMsg(index, "Format: /chestini ~number of new chest(max 100 at a time)~ (without the ~'s)", 15) End If Else Call PlayerMsg(index, "Format: /chestini ~number of new chest(max 100 at a time)~ (without the ~'s)", 15) End IfElse Call PlayerMsg(index, "Format:/chest~amount of chest you want to make(without the ~'s)~", 4) End If Else Call PlayerMsg(index, "you need higher access to use this command", 4)End IfEnd IfExit SubEnd If
Select Case LCase(Trim(TextSay))
Case "/chest"If GetPlayerAccess(index) > 0 ThenOn Error Resume nextDim temptempDim temptemptemptemptemp = 1Do While temptemp <= 1000temptemptemp = GetVar("Chests.ini " , "CHEST" & temptemp , "itemnum")If temptemptemp < 1 ThenCall PlayerMsg(index, "Chest" &temptemp, 2)temptemp = 1001ElseIf temptemptemp > 0 Thentemptemp = temptemp+1End IfLOOPEnd IfExit Sub
'********************************Sub ScriptedTile(index, Script) '********************************Select Case Script
'<><><><><>Case 0Call chest_1_sub(index)'<><><><><>Case 1Call chest_2_sub(index)'<><><><><>Case 2Call chest_3_sub(index)'<><><><><>Case 3Call chest_4_sub(index)'<><><><><>Case 4Call chest_5_sub(index)