jazzman170 Posted November 3, 2008 Author Share Posted November 3, 2008 I was messing around with my scripts to add other scripts, and had to change a few things. i got my town portal script working (i didnt make the script), the script where you run on the scripted tile and it sets it so you can type /town to return to it at any time, or when you die you return to that location. But now when and if you die before you have that location saved, you go nowhere lol. its not a huge problem cause i can just make it so a player when they start, runs right into the scripted tile, but even so i dont like haveing this little bug in my script. can somebody please take a look at my main.txt and check this out to see where i messed it up? thanks in advance! i know its a lot, but any help is well appreciated!' Eclipse Evolution 2.7 Scripting File' Global VariablesPublic GameNamePublic MAX_MAPSPublic MOTD' Color ConstantsPublic Const BLACK = 0Public Const BLUE = 1Public Const GREEN = 2Public Const CYAN = 3Public Const RED = 4Public Const MAGENTA = 5Public Const BROWN = 6Public Const GREY = 7Public Const DARKGREY = 8Public Const BRIGHTBLUE = 9Public Const BRIGHTGREEN = 10Public Const BRIGHTCYAN = 11Public Const BRIGHTRED = 12Public Const PINK = 13Public Const YELLOW = 14Public Const WHITE = 15' Admin ConstantsPublic Const ADMIN_MONITER = 1Public Const ADMIN_MAPPER = 2Public Const ADMIN_DEVELOPER = 3Public Const ADMIN_CREATOR = 4' Executes when the server initially loads.Sub OnServerLoad()GameName = GetVar("Data.ini", "CONFIG", "GameName")MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS")MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End SubIf Trim(MOTD) <> "" Then Call PlayerMsg(index, "MOTD: " & MOTD, 11)Call HighScore(Index)End If If GetPlayerAccess(index) = 4 Then Call GlobalMsg(GetPlayerName(index) & " (Administrator) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 3 Then Call GlobalMsg(GetPlayerName(index) & " (Developer) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 2 Then Call GlobalMsg(GetPlayerName(index) & " (Mapper) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 1 Then Call GlobalMsg(GetPlayerName(index) & " (Moderator) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 0 Then Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 12) End IfEnd SubEnd Sub' Executes when the scripts are reloaded.Sub OnScriptReload()GameName = GetVar("Data.ini", "CONFIG", "GameName")MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS")MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes the MOTD is changed by the client.Sub ChangeMOTD()MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes when a new character is created.Sub OnNewChar(Index, CharNum)End Sub' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds)If Minutes = 0 ThenIf Seconds = 0 ThenCall AdminMsg("Don't forget to vote for Eclipse.", YELLOW)End IfEnd IfEnd Sub' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage)Dim TargetIf Int(Damage) > 0 ThenIf Int(GetPlayerTarget(Index)) > 0 ThenTarget = GetPlayerTarget(Index)Call DamagePlayer(Index, Target, Damage)ElseTarget = GetPlayerTargetNPC(Index)Call DamageNPC(Index, Target, Damage)End IfEnd IfEnd SubSub OnArrowHit(Index, Damage)Dim TargetIf Int(Damage) > 0 ThenIf Int(GetPlayerTarget(Index)) > 0 ThenTarget = GetPlayerTarget(Index)Call DamagePlayer(Index, Target, Damage)ElseTarget = GetPlayerTargetNPC(Index)Call DamageNPC(Index, Target, Damage)End IfEnd IfEnd SubSub PlayerHit(Index, NPCNum, Damage)If Damage > 0 thenCall NPCAttack(NPCNum, Index, Damage)End IfEnd Sub' Executes when a hotkey is pressed client-side.Sub HotScript(Index, KeyID)Select Case KeyID' Executes when any player presses the PageUp key.Case 1' Executes when any player presses the Delete key.Case 2' Executes when players press the End key.Case 3' Executes when players press the PageDown key.Case 4End SelectEnd Sub' Executes when something on a custom menu is clicked.Sub MenuScripts(Index, Clicked_Index, Menu_Type)Dim MenuTitleDim FieldMessageMenuTitle = getplayermenuclicktitle(Index)FieldMessage = getplayermenuclickmsg(Index)Select Case Menu_TypeCase 1Call PlayerMsg(Index, "Clicked picture number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW)Case 2Call PlayerMsg(Index, "Clicked field number " & Clicked_Index & " on the menu named " & MenuTitle & ". The field text was " & FieldMessage, YELLOW)Case 3Call PlayerMsg(Index, "Clicked label number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW)End SelectEnd Sub' Executes when a player logs into the game.Sub JoinGame(Index)If GetPlayerAccess(Index) = 0 ThenCall GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY)ElseCall GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW)End IfCall PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE)If LenB(MOTD) <> 0 ThenCall PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN)End IfCall SendWhosOnline(Index)End Sub' Executes when a player logs out of the game.Sub LeftGame(Index)If GetPlayerAccess(Index) = 0 ThenCall GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY)ElseCall GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW)End IfEnd Sub' Executes when a players experience exceeds the next level requirement.Sub PlayerLevelUp(Index)Dim TotalExpDo While GetPlayerExp(Index) >= GetPlayerNextLevel(Index)TotalExp = GetPlayerExp(Index) - GetPlayerNextLevel(Index)Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1)Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 1)Call SetPlayerExp(Index, TotalExp)LoopCall BattleMsg(Index, "You have " & GetPlayerPOINTS(Index) & " stat points.", BRIGHTBLUE, 0)End Sub' Executes when a player uses one of the points given on an attribute to level up.Sub UsingStatPoints(Index, PointType)Select Case PointTypeCase 0If GetPlayerSTR(Index) + 1 > 1000 ThenCall BattleMsg(Index, "You have maxed your strength!", BRIGHTRED, 0)Exit SubEnd IfCall SetPlayerSTR(Index, GetPlayerSTR(Index) + 1)Call BattleMsg(Index, "You have gained more strength!", WHITE, 0)Case 1If GetPlayerDEF(Index) + 1 > 1000 ThenCall BattleMsg(Index, "You have maxed your defence!", BRIGHTRED, 0)Exit SubEnd IfCall SetPlayerDEF(Index, GetPlayerDEF(Index) + 1)Call BattleMsg(Index, "You have gained more defense!", WHITE, 0)Case 2If GetPlayerMAGI(Index) + 1 > 1000 ThenCall BattleMsg(Index, "You have maxed your magic!", BRIGHTRED, 0)Exit SubEnd IfCall SetPlayerMAGI(Index, GetPlayerMAGI(Index) + 1)Call BattleMsg(Index, "You have gained more magic!", WHITE, 0)Case 3If GetPlayerSPEED(Index) + 1 > 1000 ThenCall BattleMsg(Index, "You have maxed your speed!", BRIGHTRED, 0)Exit SubEnd IfCall SetPlayerSPEED(Index, GetPlayerSPEED(Index) + 1)Call BattleMsg(Index, "You have gained more speed!", WHITE, 0)End Select' Remove one point after the sub in question is doneCall SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) - 1)End Sub' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script)Select Case Scriptcase 0 Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "DEATH", "playerdie_map", GetPlayerMap(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "DEATH", "playerdie_x", GetPlayerX(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "DEATH", "playerdie_y", GetPlayerY(index)) Exit Subcase 1Call Uber_Scripted_Tiles(index) Exit SubCase ElseCall PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)Exit SubEnd SelectEnd Sub' Executes when a player clicks on an OnClick tile.Sub OnClick(Index, Script)Select Case ScriptCase 0Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE)Exit SubCase ElseCall PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)Exit SubEnd SelectEnd Sub' Out-dated: Executes when a player chooses yes or no on a player prompt.Sub PlayerPrompt(Index, Prompt, Value)If Prompt = 6 ThenSelect Case ValueCase 0Call GlobalMsg("Hi This is a Yes answer!", CYAN)Case 1Call GlobalMsg("This is case 1?", CYAN)End SelectElseSelect Case ValueCase 0Call GlobalMsg("Hi This is a No answer!", RED)Case 1Call GlobalMsg("This is no case 1?", RED)End SelectEnd IfEnd Sub' Out-dated: Executes query box responses.Sub QueryBox(Index, Prompt)Value = GetVar("responses.ini", "Responses", CStr(Index))End Sub' Executes every time a player drops an item.Sub OnItemDrop(Index, Map, ItemNum, ItemVal, ItemDur, ItemIndex, InvSlot)End Sub' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)End Sub' Executes whenever an NPC is killed.' Note: Death occurs as normal externally to this script.Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex)Call BattleMsg(Index, "You killed a " & getnpcname(NPCNum) & ".", BRIGHTRED, 0)End Sub' Executes when a player is killed by another.' Note: Death occurs as normal externally to this script.Sub OnPVPDeath(Attacker, Victim)Call GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), BRIGHTRED)End Sub' Executes when a player dies in an arena by another player.Sub OnArenaDeath(Attacker, Victim)Dim MapDim XDim YDim Data1Dim Data2Dim Data3Map = GetPlayerMap(Victim)X = GetPlayerX(Victim)Y = GetPlayerY(Victim)Call GlobalMsg(GetPlayerName(Victim) & " has been defeated in the arena by " & GetPlayerName(Attacker), BRIGHTRED)Call SetPlayerHP(Victim, GetPlayerMaXHP(Victim))Call SetPlayerMP(Victim, GetPlayerMaXMP(Victim))Call sendHp(Victim)Call sendMP(Victim)Data1 = GetTileData1(Map, X, Y)Data2 = GetTileData2(Map, X, Y)Data3 = GetTileData3(Map, X, Y)Call PlayerWarp(Victim, Data1, Data2, Data3)End Sub' Executes whenever a player casts a scripted spell.*******Level Up Spell*********Sub ScriptedSpell(index, Script) Select Case Script Case 0 Dim mpneeded 'Declare the MP variable mpneeded = 5 'The amount of MP needed If GetPlayerMP(index) >= mpneeded Then 'Check if the player has the required amount of MP Call SetPlayerLevel(index, GetPlayerLevel(Index) +1) 'Increase the player's level by one Call SetPlayerMP( Index, GetPlayerMP( Index) - mpneeded) 'Substract the MP thats needed Call SendStats( Index) 'Updates the player's statscall playerMsg(Index, "You granted a level!", WHITE) End If End SelectEnd SubCase ElseCall PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE)Exit SubEnd SelectEnd Sub' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script)Select Case ScriptCase 0Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE)Exit SubCase ElseCall PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)Exit SubEnd SelectEnd Sub' Executed whenever a slash command is sent to the server.'********************************Sub Commands(index)'********************************On Error Resume NextDim iDim TextSayDim nDim mDim CDim testDim mapnumDim xDim ydim tiledim mapm = GetVar("Data.ini", "MAX", "MAX_MAPS")TextSay = GetVar("Scripts\Command.ini", "TEMP", "Text" & index) i = 1C = 0'<><><><><> If LCase(Mid(TextSay, 1, 5)) = "/wish" Then If Len(TextSay) > 6 Then TextSay = Mid(TextSay, 6, Len(TextSay) - 5) Do While C = 0 If GetVar("wishes.ini", "WISH", "Wish" & i) <> "" Then i = i + 1 Else Call PutVar("wishes.ini", "WISH", "Wish" & i, Trim(TextSay)) Call PlayerMsg(index, "Thank You For Wishing!", 10) C = 1 End If Loop End If Exit Sub End If'<><><><><> 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!", 12) 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.", 14) Call PlayerMsg(index, "You have been warped to " & GetPlayerName(n) & ".", 10) Call AddLog(GetPlayerName(index) & " has warped to " & GetPlayerName(n) & ", map #" & GetPlayerMap(n) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", 12) End If Else Call PlayerMsg(index, "You cannot warp to yourself!", 12) End If End If Exit Sub End If'<><><><><>If LCase(Mid(TextSay, 1, 10)) = "/setportal" Then n = Mid(TextSay, 11, Len(TextSay) - 10) If GetPlayerAccess(index) >= 1 Then Call PlayerMsg(index, "You have created a portal opening at this spot! You may now return to this spot at any time by typing /portal " & n, 10) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "map" & n, GetPlayerMap(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "x" & n, GetPlayerX(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "y" & n, GetPlayerY(index)) Else Call PlayerMsg(index, "You do not have that ability.", 12) End If Exit SubEnd If'<><><><><>If LCase(Mid(TextSay, 1, 7)) = "/portal" Then n = Mid(TextSay, 8, Len(TextSay) - 7) mapnum = GetVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "map" & n) y = GetVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "y" & n) x = GetVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "x" & n) If GetPlayerAccess(index) >= 1 Then Call PlayerWarp(index, mapnum, x, y) Else Call PlayerMsg(index, "You do not have that ability.", 12) End IfExit SubEnd If'<><><><><> If LCase(Mid(TextSay, 1, 9)) = "/warptome" Then If Len(TextSay) > 10 Then If GetPlayerAccess(index) < 2 Then Call PlayerMsg(index, "You need be of a higher access to use this command!", 12) Exit Sub End If n = Mid(TextSay, 10, Len(TextSay) - 9) n = FindPlayer(n) If n <> index Then If n > 0 Then Call PlayerWarp(n, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)) Call PlayerMsg(n, "You have been summoned by " & GetPlayerName(index) & ".", 14) Call PlayerMsg(index, GetPlayerName(n) & " has been summoned.", 10) Call AddLog(GetPlayerName(index) & " has warped " & GetPlayerName(n) & " to self, map #" & GetPlayerMap(index) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", 12) End If Else Call PlayerMsg(index, "You cannot warp yourself to yourself!", 12) End If End If Exit Sub End If'<><><><><> If LCase(Mid(TextSay, 1, 7)) = "/warpto" Then If Len(TextSay) > 8 Then TextSay = Mid(TextSay, 8, Len(TextSay) - 7) n = TextSay If n > 0 and n <= m Then If GetPlayerAccess(index) < 2 Then Call PlayerMsg(index, "You need be of a higher access to use this command!", 12) Exit Sub End If Call PlayerWarp(index, n, GetPlayerX(index), GetPlayerY(index)) Call PlayerMsg(index, "You have been warped to map #" & n, 10) Call AddLog(GetPlayerName(index) & " warped to map #" & n & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Invalid map number.", 12) End If End If Exit Sub End If'<><><><><>If LCase(Mid(TextSay, 1, 5)) = "/case" ThenIf int(getplayeraccess(index)) > 2 ThenIf Len(TextSay) > 6 ThenTextSay = Mid(TextSay, 6, Len(TextSay) - 5)If trim(textsay) <> "" Thentile=int(getplayermapXY(index))map=int(Getplayermap(index))Call Putvar("scripts\mapextras\" & Int(map) & ".ini", "SCRIPT",Int(tile), trim(Textsay))Call PlayerMsg(index, "You have bound tile number " & int(tile) & " to the script " & Textsay & "!", 13)ElseCall Playermsg(index, "You must give a script name or number.", 13)End IfEnd IfElseCall Playermsg(index, "You have insufficient access to use this command.", 13)End IfExit SubEnd If'<><><><><>'–-----------------------------Select Case LCase(Trim(TextSay))'-------------------------------'<><><><><>Case "/help"Call PlayerMsg(index, "Social Commands:", 14)Call PlayerMsg(index, "'msghere = Broadcast Message", 15)Call PlayerMsg(index, "-msghere = Emote Message", 15)Call PlayerMsg(index, "!namehere msghere = Player Message", 15)Call PlayerMsg(index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh, /town, /8ball, /rainbow", 15)Exit Sub'<><><><><>Case "/calladmins"If GetPlayerAccess(index) = 0 Then Call AdminMsg(GetPlayerName(index) & " needs an admin!", 14) Call PlayerMsg(index, "You have requested help from an admin.", 14) Else Call PlayerMsg(index, "You are an admin, grow up and solve the problem.", 12) End IfExit Sub'<><><><><>Case "/admin"If GetPlayerAccess(index) > 0 Then Call PlayerMsg(index, "Social Commands:", 14) Call PlayerMsg(index, """msghere = Global Admin Message", 15) Call PlayerMsg(index, "=msghere = Private Admin Message", 15) Call PlayerMsg(index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", 15) End IfExit Sub'<><><><><>Case "/away"If GetPlayerAccess(index) >= 1 Then If GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 0 Then Call GlobalMsg(GetPlayerName(index) & " is now away.", 14) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 1) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName", GetPlayerName(index)) Call SetPlayerName(index, GetPlayerName(index) & " - Away") Call SendPlayerData(index) Exit Sub ElseIf GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 1 Then Call SetPlayerName(index, GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName")) Call GlobalMsg(GetPlayerName(index) & " has returned from being away.", 14) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 0) Call SendPlayerData(index) Exit Sub End IfEnd If'<><><><><>Case "/test"Call testmain(index)Exit Sub'<><><><><>Case "/town"Call use_town_portal(index) Exit Sub'<><><><><>Case "/top5"call HighScore(index)exit sub'<><><><><>End SelectCall PlayerMsg(index, "Thats not a valid command!", 12)End Sub'********************************Sub Set_town_portal(index)'********************************Dim townmapDim townxDim towny townmap = 0 + GetPlayerMap(index) townx = 0 + GetPlayerX(index) towny = 0 + GetPlayerY(index) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap", 0 + townmap) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townx", 0 + townx) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "towny", 0 + towny) Call PlayerMsg(index, "Your soul is now bound to this portal arch. Type /town to return here. " , 10)End Sub'********************************Sub use_town_portal(index) '********************************Dim townmapDim townxDim townyIf GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") <> "" Then townmap = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") ) townx = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townx") ) towny = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "towny") ) Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) ) Call Playermsg(index,"You summon a town portal returning you to town.", 10)Else Call Playermsg(index,"You have not yet set a town to return to.", 12) End IfEnd Sub**************************'*AutoUpdatingHighScoreScript*'*******Version1.2**********'*************************Sub HighScore(index)Dim acc(50)Dim Char(50)Dim Charlvl(50)i=1j=1C=0Cnum = 0Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index))Do While C = 0acc(i) = GetVar("accounts.ini", "Players", "Name" & i)If acc(i) <> "" Then'Call PlayerMsg(index, acc(i), 1)j = 1Do While j < 4If GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name") <> "" ThenCnum=Cnum+1Char(Cnum) = GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name")Charlvl(Cnum) = INT(GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Level"))End Ifj = j + 1Loopi = i + 1ElseC=1Max=(i - 1)End IfLoopCa=1Cb=2Do While Ca < CnumDo While Cb <= Cnum'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)If Charlvl(Ca) < Charlvl(Cb) Then'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)templvla = Charlvl(Ca)templvlb = Charlvl(Cb)tempnamea = Char(Ca)tempnameb = Char(Cb)Charlvl(Ca) = templvlbCharlvl(Cb) = templvlaChar(Ca) = tempnamebChar(Cb) = tempnamea'Call PlayerMsg(index, "Switching", 1)End IfCb=(Cb + 1)LoopCa=(Ca + 1)Cb=(Ca + 1)'Call PlayerMsg (index, Ca & Cb, 1)LoopCall battleMsg(index, "Top 5 Players by Level", 15, 0)Ca=1Do While Ca <= 5Call battleMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12, 0)Ca=Ca+1LoopEnd SubSub UpdateScore(index)Dim acc(50)Dim Char(50)Dim Charlvl(50)i=1j=1C=0Cnum = 0Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index))Do While C = 0acc(i) = GetVar("accounts.ini", "Players", "Name" & i)If acc(i) <> "" Then'Call PlayerMsg(index, acc(i), 1)j = 1Do While j < 4If GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name") <> "" ThenCnum=Cnum+1Char(Cnum) = GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name")Charlvl(Cnum) = INT(GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Level"))End Ifj = j + 1Loopi = i + 1ElseC=1Max=(i - 1)End IfLoopCa=1Cb=2Do While Ca < CnumDo While Cb <= Cnum'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)If Charlvl(Ca) < Charlvl(Cb) Then'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)templvla = Charlvl(Ca)templvlb = Charlvl(Cb)tempnamea = Char(Ca)tempnameb = Char(Cb)Charlvl(Ca) = templvlbCharlvl(Cb) = templvlaChar(Ca) = tempnamebChar(Cb) = tempnamea'Call PlayerMsg(index, "Switching", 1)End IfCb=(Cb + 1)LoopCa=(Ca + 1)Cb=(Ca + 1)'Call PlayerMsg (index, Ca & Cb, 1)LoopCall globalMsg(index, "Top 5 Players by Level", 15)Ca=1Do While Ca <= 5Call globalMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12)Ca=Ca+1LoopEnd SubSub SwimStart(index, sprite, message, color) If GetPlayerSprite(index) = sprite Then Call BlockPlayer(index) Call PlayerMsg(index, "Sorry, you cant swim.", 1) Else Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "TempSprite" , 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "TempSprite" , GetPlayerSprite(index)) Call SetPlayerSprite(index, sprite) Call PlayerMsg(index, message, color) Call SendPlayerData(index) End IfEnd Sub'********************************Function getplayermapXY(index)'********************************Dim xDim yx=1+GetPlayerX(index)y=GetPlayerY(index)getplayermapxy=x+(20*y)End Function'********************************' Executes on death, dropping all of the players items.Sub DropItems(Index)' Remove this to enable.Exit SubIf GetPlayerWeaponSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerWeaponSlot(Index), 0)End IfIf GetPlayerArmorSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerArmorSlot(Index), 0)End IfIf GetPlayerHelmetSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerHelmetSlot(Index), 0)End IfIf GetPlayerShieldSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerShieldSlot(Index), 0)End IfIf GetPlayerLegsSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerLegsSlot(Index), 0)End IfIf GetPlayerRingSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerRingSlot(Index), 0)End IfIf GetPlayerNecklaceSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerNecklaceSlot(Index), 0)End IfEnd Sub'********************************Sub OnDeath(index) '********************************Dim townmapDim townxDim townyIf GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") > 0 Then townmap = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") ) townx = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townx") ) towny = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "towny") ) Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )Elsetownx=29towny=22townmap=1Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )End IfCall Dropitems(index)End Sub'********************************' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script)Select Case Scriptcase 0Call SetPlayerLevel( Index, GetPlayerLevel( Index) +1)Sub TakeItem(Index, 5, 1)Call SendInventory( Index)Case ElseCall PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)Exit SubEnd SelectEnd Sub' Map AttributesSub SetBlank(Map, X, Y)Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")End SubSub SetBlock(Map, X, Y)Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")End SubSub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY)Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")End SubSub SetItem(Map, X, Y, ItemID, ItemValue)Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")End SubSub SetNPCAvoid(Map, X, Y)Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")End SubSub SetKeY(Map, X, Y, KeyID, KeyTake)Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")End SubSub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message)Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")End SubSub SetHeal(Map, X, Y)Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")End SubSub SetKill(Map, X, Y)Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")End SubSub SetShop(Map, X, Y, ShopID)Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")End SubSub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3)Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")End SubSub SetArena(Map, X, Y, MapID, NewX, NewY)Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")End SubSub SetSound(Map, X, Y, FileName)Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")End SubSub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost)Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")End SubSub SetSign(Map, X, Y, Line1, Line2, Line3)Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)End SubSub SetDoor(Map, X, Y)Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")End SubSub SetNotice(Map, X, Y, Title, Text, FileName)Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)End SubSub SetScripted(Map, X, Y, Script)Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")End SubSub SetBank(Map, X, Y)Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")End Sub'**********************Function GetFreeSlots(Index) Dim Slot Dim Slots Slot = 1 Slots = 0 Index = Int(Index) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Slots = Slots + 1 End If Slot = Slot + 1 Loop GetFreeSlots = SlotsEnd FunctionSub GiveItem(Index, Number, Durability) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Durability = Int(Durability) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemDur(Index, Slot, Durability) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 LoopEnd SubSub GiveCurrency(Index, Number, Amount) Dim Slot Dim CurrentAmount Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemValue(Index, Slot, Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 LoopEnd SubFunction CanTake(Index, Number, Amount) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CanTake = True Exit Function End If End If Slot = Slot + 1 Loop CanTake = FalseEnd FunctionSub TakeItem(Index, Number, Amount) Dim Slot Dim CurrentAmount Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) If CurrentAmount <= Amount Then Call SetPlayerInvItemNum(Index, Slot, 0) Call SetPlayerInvItemValue(Index, Slot, 0) Call SetPlayerInvItemDur(Index, Slot, 0) Call SendInventoryUpdate(Index, Slot) Else Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount) Call SendInventoryUpdate(Index, Slot) End If Exit Sub End If End If Slot = Slot + 1 LoopEnd Sub'********************************Function getplayermapXY(index)'********************************Dim xDim yx=1+GetPlayerX(index)y=GetPlayerY(index)getplayermapxy=x+(20*y)End Function'********************************Sub Uber_Scripted_Tiles(index)'********************************On error resume nextDim scriptdim mapdim tiletile=int(getplayermapXY(index))map=int(Getplayermap(index))script=Getvar("scripts\mapextras\" & Int(map) & ".ini", "SCRIPT",Int(tile))Select case script Case "Uber" Call playermsg(index, "This truly is an uber script. Done well Baron :D", 13) Exit Sub Case "savepoint" Call Set_town_portal(index) Exit Sub Case Else Call playermsg(index, "No script was found matching that title", 13) Exit SubEnd SelectEnd Sub' Tests scripts up to the location of Sub TestMain(Index).' Leave this sub at the bottom to test the entire script file.Sub TestMain(Index)Call PlayerMsg(Index, "Scripts are working properly.", BRIGHTGREEN)End Sub Link to comment Share on other sites More sharing options...
DarkMazer Posted November 3, 2008 Share Posted November 3, 2008 See this?> **************************> '*AutoUpdatingHighScoreScript*> '*******Version1.2**********> '*************************Try putting a ' in front of the top line of asterisks. Link to comment Share on other sites More sharing options...
jazzman170 Posted November 3, 2008 Author Share Posted November 3, 2008 ok i added the " ' " but it didnt change anything ^^ thanks for trying tho! anybody else have any comments about this one? lol :P Link to comment Share on other sites More sharing options...
Khachaturian Posted November 4, 2008 Share Posted November 4, 2008 Hmmmfor one, put your main text in between these [*code] MAIN TEXT HERE [*/code]without the *'sEasier on the eyes Link to comment Share on other sites More sharing options...
DarkMazer Posted November 4, 2008 Share Posted November 4, 2008 First, find this:> If Trim(MOTD) <> "" Then> Call PlayerMsg(index, "MOTD: " & MOTD, 11)> Call HighScore(Index)> End If> If GetPlayerAccess(index) = 4 Then> Call GlobalMsg(GetPlayerName(index) & " (Administrator) has joined " & GameName & "!", 12)> End If> If GetPlayerAccess(index) = 3 Then> Call GlobalMsg(GetPlayerName(index) & " (Developer) has joined " & GameName & "!", 12)> End If> If GetPlayerAccess(index) = 2 Then> Call GlobalMsg(GetPlayerName(index) & " (Mapper) has joined " & GameName & "!", 12)> End If> If GetPlayerAccess(index) = 1 Then> Call GlobalMsg(GetPlayerName(index) & " (Moderator) has joined " & GameName & "!", 12)> End If> If GetPlayerAccess(index) = 0 Then> Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 12)> End If> End Sub> End SubTake out the two "End Sub" statements there, then cut the text out and go to Sub JoinGame(index). Once you find that, replace this segment:> If LenB(MOTD) <> 0 Then> Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN)> End IfWith the code you cut out. Next, find this:> *******Level Up Spell*********And put a ' in front of it. While you're there, find this:> If GetPlayerMP(index) >= mpneeded Then 'Check if the player has the required amount of MP> Call SetPlayerLevel(index, GetPlayerLevel(Index) +1) 'Increase the player's level by one> Call SetPlayerMP( Index, GetPlayerMP( Index) - mpneeded) 'Substract the MP thats needed> Call SendStats( Index) 'Updates the player's stats> call playerMsg(Index, "You granted a level!", WHITE)> > End If> End Select> End SubAnd take out the End Select and End Sub statements.Next, find this:> case 0> Call SetPlayerLevel( Index, GetPlayerLevel( Index) +1)> Sub TakeItem(Index, 5, 1)> Call SendInventory( Index)And change the "Sub" to "Call". Try that and see if it works. With all of those syntax errors, it's no wonder you weren't dying properly. Link to comment Share on other sites More sharing options...
Khachaturian Posted November 4, 2008 Share Posted November 4, 2008 I think that 'end select' needs to be thereSeeing its after the cases, so it stops selecting casesbut then theres a 'case else'I could be wrongA tip : Back up your Main.txt after every script Link to comment Share on other sites More sharing options...
DarkMazer Posted November 4, 2008 Share Posted November 4, 2008 @Bone:> I think that 'end select' needs to be there> Seeing its after the cases, so it stops selecting cases> but then theres a 'case else'> > I could be wrong> > A tip : Back up your Main.txt after every scriptThere does need to be an End Select, but only one; otherwise the script complains. The one already there after Case Else is the one that should be kept. And yes, that's a very good tip. Link to comment Share on other sites More sharing options...
jazzman170 Posted November 4, 2008 Author Share Posted November 4, 2008 ok i did everything you asked. i still respawn in the same place that im killed, and changing the scripted item case 0 one, i changed it from Sub to Call, and no it didnt fix it. but tyvvm for helping me get rid of a few minor bugs/erros :D anybody else have any helpfull advice? all is much appreciated! Link to comment Share on other sites More sharing options...
Anonymous Posted November 6, 2008 Share Posted November 6, 2008 *cringe*All apologies for the long post. Syntactically correct here. If that doesn't fix the problem, it's something else.```' Eclipse Evolution 2.7 Scripting File' Global VariablesPublic GameNamePublic MAX_MAPSPublic MOTD' Color ConstantsPublic Const BLACK = 0Public Const BLUE = 1Public Const GREEN = 2Public Const CYAN = 3Public Const RED = 4Public Const MAGENTA = 5Public Const BROWN = 6Public Const GREY = 7Public Const DARKGREY = 8Public Const BRIGHTBLUE = 9Public Const BRIGHTGREEN = 10Public Const BRIGHTCYAN = 11Public Const BRIGHTRED = 12Public Const PINK = 13Public Const YELLOW = 14Public Const WHITE = 15' Admin ConstantsPublic Const ADMIN_MONITER = 1Public Const ADMIN_MAPPER = 2Public Const ADMIN_DEVELOPER = 3Public Const ADMIN_CREATOR = 4' Executes when the server initially loads.Sub OnServerLoad() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End SubSub JoinGame(Index)If Trim(MOTD) <> "" Then Call PlayerMsg(index, "MOTD: " & MOTD, 11) Call HighScore(Index) End If If GetPlayerAccess(index) = 4 Then Call GlobalMsg(GetPlayerName(index) & " (Administrator) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 3 Then Call GlobalMsg(GetPlayerName(index) & " (Developer) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 2 Then Call GlobalMsg(GetPlayerName(index) & " (Mapper) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 1 Then Call GlobalMsg(GetPlayerName(index) & " (Moderator) has joined " & GameName & "!", 12) End If If GetPlayerAccess(index) = 0 Then Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 12) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) Call SendWhosOnline(Index)End Sub' Executes when the scripts are reloaded.Sub OnScriptReload() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes the MOTD is changed by the client.Sub ChangeMOTD() MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes when a new character is created.Sub OnNewChar(Index, CharNum)End Sub' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds) If Minutes = 0 Then If Seconds = 0 Then Call AdminMsg("Don't forget to vote for Eclipse.", YELLOW) End If End IfEnd Sub' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End IfEnd SubSub OnArrowHit(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End IfEnd SubSub PlayerHit(Index, NPCNum, Damage) If Damage > 0 Then Call NPCAttack(NPCNum, Index, Damage) End IfEnd Sub' Executes when a hotkey is pressed client-side.Sub HotScript(Index, KeyID) Select Case KeyID ' Executes when any player presses the PageUp key. Case 1 ' Executes when any player presses the Delete key. Case 2 ' Executes when players press the End key. Case 3 ' Executes when players press the PageDown key. Case 4 End SelectEnd Sub' Executes when something on a custom menu is clicked.Sub MenuScripts(Index, Clicked_Index, Menu_Type) Dim MenuTitle Dim FieldMessage MenuTitle = getplayermenuclicktitle(Index) FieldMessage = getplayermenuclickmsg(Index) Select Case Menu_Type Case 1 Call PlayerMsg(Index, "Clicked picture number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) Case 2 Call PlayerMsg(Index, "Clicked field number " & Clicked_Index & " on the menu named " & MenuTitle & ". The field text was " & FieldMessage, YELLOW) Case 3 Call PlayerMsg(Index, "Clicked label number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) End SelectEnd Sub' Executes when a player logs out of the game.Sub LeftGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW) End IfEnd Sub' Executes when a players experience exceeds the next level requirement.Sub PlayerLevelUp(Index) Dim TotalExp Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index) TotalExp = GetPlayerExp(Index) - GetPlayerNextLevel(Index) Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1) Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 1) Call SetPlayerExp(Index, TotalExp) Loop Call BattleMsg(Index, "You have " & GetPlayerPOINTS(Index) & " stat points.", BRIGHTBLUE, 0)End Sub' Executes when a player uses one of the points given on an attribute to level up.Sub UsingStatPoints(Index, PointType) Select Case PointType Case 0 If GetPlayerSTR(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your strength!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 1) Call BattleMsg(Index, "You have gained more strength!", WHITE, 0) Case 1 If GetPlayerDEF(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your defence!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 1) Call BattleMsg(Index, "You have gained more defense!", WHITE, 0) Case 2 If GetPlayerMAGI(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your magic!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerMAGI(Index, GetPlayerMAGI(Index) + 1) Call BattleMsg(Index, "You have gained more magic!", WHITE, 0) Case 3 If GetPlayerSPEED(Index) + 1 > 1000 Then Call BattleMsg(Index, "You have maxed your speed!", BRIGHTRED, 0) Exit Sub End If Call SetPlayerSPEED(Index, GetPlayerSPEED(Index) + 1) Call BattleMsg(Index, "You have gained more speed!", WHITE, 0) End Select ' Remove one point after the sub in question is done Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) - 1)End Sub' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "DEATH", "playerdie_map", GetPlayerMap(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "DEATH", "playerdie_x", GetPlayerX(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "DEATH", "playerdie_y", GetPlayerY(index)) Exit SubCase 1Call Uber_Scripted_Tiles(index) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executes when a player clicks on an OnClick tile.Sub OnClick(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Out-dated: Executes when a player chooses yes or no on a player prompt.Sub PlayerPrompt(Index, Prompt, Value) If Prompt = 6 Then Select Case Value Case 0 Call GlobalMsg("Hi This is a Yes answer!", CYAN) Case 1 Call GlobalMsg("This is case 1?", CYAN) End Select Else Select Case Value Case 0 Call GlobalMsg("Hi This is a No answer!", RED) Case 1 Call GlobalMsg("This is no case 1?", RED) End Select End IfEnd Sub' Out-dated: Executes query box responses.Sub QueryBox(Index, Prompt) Value = GetVar("responses.ini", "Responses", CStr(Index))End Sub' Executes every time a player drops an item.Sub OnItemDrop(Index, Map, ItemNum, ItemVal, ItemDur, ItemIndex, InvSlot)End Sub' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)End Sub' Executes whenever an NPC is killed.' Note: Death occurs as normal externally to this script.Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex) Call BattleMsg(Index, "You killed a " & getnpcname(NPCNum) & ".", BRIGHTRED, 0)End Sub' Executes when a player is killed by another.' Note: Death occurs as normal externally to this script.Sub OnPVPDeath(Attacker, Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), BRIGHTRED)End Sub' Executes when a player dies in an arena by another player.Sub OnArenaDeath(Attacker, Victim) Dim Map Dim X Dim Y Dim Data1 Dim Data2 Dim Data3 Map = GetPlayerMap(Victim) X = GetPlayerX(Victim) Y = GetPlayerY(Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been defeated in the arena by " & GetPlayerName(Attacker), BRIGHTRED) Call SetPlayerHP(Victim, GetPlayerMaXHP(Victim)) Call SetPlayerMP(Victim, GetPlayerMaXMP(Victim)) Call sendHp(Victim) Call sendMP(Victim) Data1 = GetTileData1(Map, X, Y) Data2 = GetTileData2(Map, X, Y) Data3 = GetTileData3(Map, X, Y) Call PlayerWarp(Victim, Data1, Data2, Data3)End Sub' Executes whenever a player casts a scripted spell.'*******Level Up Spell*********Sub ScriptedSpell(index, Script) Select Case Script Case 0 Dim mpneeded 'Declare the MP variable mpneeded = 5 'The amount of MP needed If GetPlayerMP(index) >= mpneeded Then 'Check if the player has the required amount of MP Call SetPlayerLevel(index, GetPlayerLevel(Index) +1) 'Increase the player's level by one Call SetPlayerMP( Index, GetPlayerMP( Index) - mpneeded) 'Substract the MP thats needed Call SendStats( Index) 'Updates the player's stats Call playerMsg(Index, "You granted a level!", WHITE) End If Case Else Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executed whenever a slash command is sent to the server.'********************************Sub Commands(index)'********************************On Error Resume Next Dim iDim TextSayDim nDim mDim CDim testDim mapnumDim xDim yDim tile Dim mapm = GetVar("Data.ini", "MAX", "MAX_MAPS")TextSay = GetVar("Scripts\Command.ini", "TEMP", "Text" & index) i = 1C = 0'<><><><><> If LCase(Mid(TextSay, 1, 5)) = "/wish" Then If Len(TextSay) > 6 Then TextSay = Mid(TextSay, 6, Len(TextSay) - 5) Do While C = 0 If GetVar("wishes.ini", "WISH", "Wish" & i) <> "" Then i = i + 1 Else Call PutVar("wishes.ini", "WISH", "Wish" & i, Trim(TextSay)) Call PlayerMsg(index, "Thank You For Wishing!", 10) C = 1 End If Loop End If Exit Sub End If'<><><><><> 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!", 12) 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.", 14) Call PlayerMsg(index, "You have been warped to " & GetPlayerName(n) & ".", 10) Call AddLog(GetPlayerName(index) & " has warped to " & GetPlayerName(n) & ", map #" & GetPlayerMap(n) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", 12) End If Else Call PlayerMsg(index, "You cannot warp to yourself!", 12) End If End If Exit Sub End If'<><><><><> If LCase(Mid(TextSay, 1, 10)) = "/setportal" Then n = Mid(TextSay, 11, Len(TextSay) - 10) If GetPlayerAccess(index) >= 1 Then Call PlayerMsg(index, "You have created a portal opening at this spot! You may now return to this spot at any time by typing /portal " & n, 10) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "map" & n, GetPlayerMap(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "x" & n, GetPlayerX(index)) Call PutVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "y" & n, GetPlayerY(index)) Else Call PlayerMsg(index, "You do not have that ability.", 12) End If Exit Sub End If'<><><><><> If LCase(Mid(TextSay, 1, 7)) = "/portal" Then n = Mid(TextSay, 8, Len(TextSay) - 7) mapnum = GetVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "map" & n) y = GetVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "y" & n) x = GetVar("scripts\charextras\" & trim(GetPlayerName(index)) & ".ini", "PORTALS", "x" & n) If GetPlayerAccess(index) >= 1 Then Call PlayerWarp(index, mapnum, x, y) Else Call PlayerMsg(index, "You do not have that ability.", 12) End If Exit Sub End If'<><><><><> If LCase(Mid(TextSay, 1, 9)) = "/warptome" Then If Len(TextSay) > 10 Then If GetPlayerAccess(index) < 2 Then Call PlayerMsg(index, "You need be of a higher access to use this command!", 12) Exit Sub End If n = Mid(TextSay, 10, Len(TextSay) - 9) n = FindPlayer(n) If n <> index Then If n > 0 Then Call PlayerWarp(n, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)) Call PlayerMsg(n, "You have been summoned by " & GetPlayerName(index) & ".", 14) Call PlayerMsg(index, GetPlayerName(n) & " has been summoned.", 10) Call AddLog(GetPlayerName(index) & " has warped " & GetPlayerName(n) & " to self, map #" & GetPlayerMap(index) & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Player is not online.", 12) End If Else Call PlayerMsg(index, "You cannot warp yourself to yourself!", 12) End If End If Exit Sub End If'<><><><><> If LCase(Mid(TextSay, 1, 7)) = "/warpto" Then If Len(TextSay) > 8 Then TextSay = Mid(TextSay, 8, Len(TextSay) - 7) n = TextSay If n > 0 And n <= m Then If GetPlayerAccess(index) < 2 Then Call PlayerMsg(index, "You need be of a higher access to use this command!", 12) Exit Sub End If Call PlayerWarp(index, n, GetPlayerX(index), GetPlayerY(index)) Call PlayerMsg(index, "You have been warped to map #" & n, 10) Call AddLog(GetPlayerName(index) & " warped to map #" & n & ".", ADMIN_LOG) Else Call PlayerMsg(index, "Invalid map number.", 12) End If End If Exit Sub End If'<><><><><>If LCase(Mid(TextSay, 1, 5)) = "/case" Then If int(getplayeraccess(index)) > 2 Then If Len(TextSay) > 6 Then TextSay = Mid(TextSay, 6, Len(TextSay) - 5) If trim(textsay) <> "" Then tile=int(getplayermapXY(index)) map=int(Getplayermap(index)) Call Putvar("scripts\mapextras\" & Int(map) & ".ini", "SCRIPT",Int(tile), trim(Textsay)) Call PlayerMsg(index, "You have bound tile number " & int(tile) & " to the script " & Textsay & "!", 13) Else Call Playermsg(index, "You must give a script name or number.", 13) End If End If Else Call Playermsg(index, "You have insufficient access to use this command.", 13) End If Exit Sub End If '<><><><><>'-------------------------------Select Case LCase(Trim(TextSay))'-------------------------------'<><><><><>Case "/help"Call PlayerMsg(index, "Social Commands:", 14)Call PlayerMsg(index, "'msghere = Broadcast Message", 15)Call PlayerMsg(index, "-msghere = Emote Message", 15)Call PlayerMsg(index, "!namehere msghere = Player Message", 15)Call PlayerMsg(index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh, /town, /8ball, /rainbow", 15)Exit Sub'<><><><><>Case "/calladmins" If GetPlayerAccess(index) = 0 Then Call AdminMsg(GetPlayerName(index) & " needs an admin!", 14) Call PlayerMsg(index, "You have requested help from an admin.", 14) Else Call PlayerMsg(index, "You are an admin, grow up and solve the problem.", 12) End IfExit Sub'<><><><><>Case "/admin" If GetPlayerAccess(index) > 0 Then Call PlayerMsg(index, "Social Commands:", 14) Call PlayerMsg(index, """msghere = Global Admin Message", 15) Call PlayerMsg(index, "=msghere = Private Admin Message", 15) Call PlayerMsg(index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", 15) End IfExit Sub'<><><><><>Case "/away" If GetPlayerAccess(index) >= 1 Then If GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 0 Then Call GlobalMsg(GetPlayerName(index) & " is now away.", 14) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 1) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName", GetPlayerName(index)) Call SetPlayerName(index, GetPlayerName(index) & " - Away") Call SendPlayerData(index) Exit Sub ElseIf GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 1 Then Call SetPlayerName(index, GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName")) Call GlobalMsg(GetPlayerName(index) & " has returned from being away.", 14) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 0) Call SendPlayerData(index) Exit Sub End If End If'<><><><><> Case "/test"Call testmain(index)Exit Sub'<><><><><> Case "/town"Call use_town_portal(index) Exit Sub'<><><><><>Case "/top5" Call HighScore(index) Exit Sub '<><><><><>End SelectCall PlayerMsg(index, "Thats not a valid command!", 12)End Sub'********************************Sub Set_town_portal(index)'******************************** Dim townmapDim townxDim towny townmap = 0 + GetPlayerMap(index) townx = 0 + GetPlayerX(index) towny = 0 + GetPlayerY(index) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap", 0 + townmap) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townx", 0 + townx) Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "towny", 0 + towny) Call PlayerMsg(index, "Your soul is now bound to this portal arch. Type /town to return here. " , 10)End Sub'********************************Sub use_town_portal(index) '********************************Dim townmapDim townxDim townyIf GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") <> "" Then townmap = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") ) townx = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townx") ) towny = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "towny") ) Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) ) Call Playermsg(index,"You summon a town portal returning you to town.", 10)Else Call Playermsg(index,"You have not yet set a town to return to.", 12) End If End Sub '************************** '*AutoUpdatingHighScoreScript* '*******Version1.2********** '************************* Sub HighScore(index) Dim acc(50) Dim Char(50) Dim Charlvl(50) i=1 j=1 C=0 Cnum = 0 Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index)) Do While C = 0 acc(i) = GetVar("accounts.ini", "Players", "Name" & i) If acc(i) <> "" Then 'Call PlayerMsg(index, acc(i), 1) j = 1 Do While j < 4 If GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name") <> "" Then Cnum=Cnum+1 Char(Cnum) = GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name") Charlvl(Cnum) = INT(GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Level")) End If j = j + 1 Loop i = i + 1 Else C=1 Max=(i - 1) End If Loop Ca=1 Cb=2 Do While Ca < Cnum Do While Cb <= Cnum 'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1) If Charlvl(Ca) < Charlvl(Cb) Then 'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1) templvla = Charlvl(Ca) templvlb = Charlvl(Cb) tempnamea = Char(Ca) tempnameb = Char(Cb) Charlvl(Ca) = templvlb Charlvl(Cb) = templvla Char(Ca) = tempnameb Char(Cb) = tempnamea 'Call PlayerMsg(index, "Switching", 1) End If Cb=(Cb + 1) Loop Ca=(Ca + 1) Cb=(Ca + 1) 'Call PlayerMsg (index, Ca & Cb, 1) Loop Call battleMsg(index, "Top 5 Players by Level", 15, 0) Ca=1 Do While Ca <= 5 Call battleMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12, 0) Ca=Ca+1 Loop End Sub Sub UpdateScore(index) Dim acc(50) Dim Char(50) Dim Charlvl(50) i=1 j=1 C=0 Cnum = 0 Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index)) Do While C = 0 acc(i) = GetVar("accounts.ini", "Players", "Name" & i) If acc(i) <> "" Then 'Call PlayerMsg(index, acc(i), 1) j = 1 Do While j < 4 If GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name") <> "" Then Cnum=Cnum+1 Char(Cnum) = GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Name") Charlvl(Cnum) = INT(GetVar("accounts\" & acc(i) & ".ini", "CHAR" & j, "Level")) End If j = j + 1 Loop i = i + 1 Else C=1 Max=(i - 1) End If Loop Ca=1 Cb=2 Do While Ca < Cnum Do While Cb <= Cnum 'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1) If Charlvl(Ca) < Charlvl(Cb) Then 'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1) templvla = Charlvl(Ca) templvlb = Charlvl(Cb) tempnamea = Char(Ca) tempnameb = Char(Cb) Charlvl(Ca) = templvlb Charlvl(Cb) = templvla Char(Ca) = tempnameb Char(Cb) = tempnamea 'Call PlayerMsg(index, "Switching", 1) End If Cb=(Cb + 1) Loop Ca=(Ca + 1) Cb=(Ca + 1) 'Call PlayerMsg (index, Ca & Cb, 1) Loop Call globalMsg(index, "Top 5 Players by Level", 15) Ca=1 Do While Ca <= 5 Call globalMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12) Ca=Ca+1 Loop End SubSub SwimStart(index, sprite, message, color) If GetPlayerSprite(index) = sprite Then Call BlockPlayer(index) Call PlayerMsg(index, "Sorry, you cant swim.", 1) Else Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "TempSprite" , 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "TempSprite" , GetPlayerSprite(index)) Call SetPlayerSprite(index, sprite) Call PlayerMsg(index, message, color) Call SendPlayerData(index) End If End Sub'******************************** Function getplayermapXY(index) '******************************** Dim x Dim y x=1+GetPlayerX(index) y=GetPlayerY(index) getplayermapxy=x+(20*y) End Function '********************************' Executes on death, dropping all of the players items.Sub DropItems(Index) ' Remove this to enable. Exit Sub If GetPlayerWeaponSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerWeaponSlot(Index), 0) End If If GetPlayerArmorSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerArmorSlot(Index), 0) End If If GetPlayerHelmetSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerHelmetSlot(Index), 0) End If If GetPlayerShieldSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerShieldSlot(Index), 0) End If If GetPlayerLegsSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerLegsSlot(Index), 0) End If If GetPlayerRingSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerRingSlot(Index), 0) End If If GetPlayerNecklaceSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerNecklaceSlot(Index), 0) End IfEnd Sub'********************************Sub OnDeath(index) '********************************Dim townmapDim townxDim townyIf GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") > 0 Then townmap = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townmap") ) townx = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "townx") ) towny = Int( GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini", "TOWNPORTS", "towny") ) Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )Elsetownx=29towny=22townmap=1Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )End IfCall Dropitems(index)End Sub'********************************' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script) Select Case ScriptCase 0Call SetPlayerLevel( Index, GetPlayerLevel( Index) +1)Call TakeItem(Index, 5, 1)Call SendInventory( Index) Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Map AttributesSub SetBlank(Map, X, Y) Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")End SubSub SetBlock(Map, X, Y) Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")End SubSub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY) Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")End SubSub SetItem(Map, X, Y, ItemID, ItemValue) Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")End SubSub SetNPCAvoid(Map, X, Y) Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")End SubSub SetKeY(Map, X, Y, KeyID, KeyTake) Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")End SubSub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message) Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")End SubSub SetHeal(Map, X, Y) Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")End SubSub SetKill(Map, X, Y) Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")End SubSub SetShop(Map, X, Y, ShopID) Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")End SubSub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3) Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")End SubSub SetArena(Map, X, Y, MapID, NewX, NewY) Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")End SubSub SetSound(Map, X, Y, FileName) Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")End SubSub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost) Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")End SubSub SetSign(Map, X, Y, Line1, Line2, Line3) Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)End SubSub SetDoor(Map, X, Y) Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")End SubSub SetNotice(Map, X, Y, Title, Text, FileName) Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)End SubSub SetScripted(Map, X, Y, Script) Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")End SubSub SetBank(Map, X, Y) Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")End Sub'**********************Function GetFreeSlots(Index) Dim Slot Dim Slots Slot = 1 Slots = 0 Index = Int(Index) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Slots = Slots + 1 End If Slot = Slot + 1 Loop GetFreeSlots = SlotsEnd FunctionSub GiveItem(Index, Number, Durability) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Durability = Int(Durability) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemDur(Index, Slot, Durability) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 LoopEnd SubSub GiveCurrency(Index, Number, Amount) Dim Slot Dim CurrentAmount Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 Loop Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = 0 Then Call SetPlayerInvItemNum(Index, Slot, Number) Call SetPlayerInvItemValue(Index, Slot, Amount) Call SendInventoryUpdate(Index, Slot) Exit Sub End If Slot = Slot + 1 LoopEnd SubFunction CanTake(Index, Number, Amount) Dim Slot Slot = 1 Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CanTake = True Exit Function End If End If Slot = Slot + 1 Loop CanTake = FalseEnd FunctionSub TakeItem(Index, Number, Amount) Dim Slot Dim CurrentAmount Index = Int(Index) Number = Int(Number) Amount = Int(Amount) Slot = 1 Do While Slot < 25 If GetPlayerInvItemNum(Index, Slot) = Number Then If GetPlayerInvItemValue(Index, Slot) >= Amount Then CurrentAmount = GetPlayerInvItemValue(Index, Slot) If CurrentAmount <= Amount Then Call SetPlayerInvItemNum(Index, Slot, 0) Call SetPlayerInvItemValue(Index, Slot, 0) Call SetPlayerInvItemDur(Index, Slot, 0) Call SendInventoryUpdate(Index, Slot) Else Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount) Call SendInventoryUpdate(Index, Slot) End If Exit Sub End If End If Slot = Slot + 1 LoopEnd Sub'********************************Function getplayermapXY(index) '********************************Dim xDim yx=1+GetPlayerX(index)y=GetPlayerY(index)getplayermapxy=x+(20*y)End Function'********************************Sub Uber_Scripted_Tiles(index)'********************************On Error Resume NextDim scriptDim mapDim tiletile=int(getplayermapXY(index))map=int(Getplayermap(index))script=Getvar("scripts\mapextras\" & Int(map) & ".ini", "SCRIPT",Int(tile))Select Case script Case "Uber" Call playermsg(index, "This truly is an uber script. Done well Baron :D", 13) Exit Sub Case "savepoint" Call Set_town_portal(index) Exit Sub Case Else Call playermsg(index, "No script was found matching that title", 13) Exit SubEnd SelectEnd Sub' Tests scripts up to the location of Sub TestMain(Index).' Leave this sub at the bottom to test the entire script file.Sub TestMain(Index) Call PlayerMsg(Index, "Scripts are working properly.", BRIGHTGREEN)End Sub``` Link to comment Share on other sites More sharing options...
Akselj Posted November 8, 2008 Share Posted November 8, 2008 Well, if you still haven't got it fixed, check "Properties" in map editor. I did a mistake in there once, I didn't think of how many coordinates the were at each map. You respawn in nowere if you set the coordinates higher than 30. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now