Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Post Your Main.txt!!! (Why the hell not)


DrNova
 Share

Recommended Posts

> ' Eclipse Evolution 2.7 Scripting File
>
> ' Global Variables
> Public GameName
> Public MAX_MAPS
> Public MOTD
>
> ' Color Constants
> Public Const BLACK = 0
> Public Const BLUE = 1
> Public Const GREEN = 2
> Public Const CYAN = 3
> Public Const RED = 4
> Public Const MAGENTA = 5
> Public Const BROWN = 6
> Public Const GREY = 7
> Public Const DARKGREY = 8
> Public Const BRIGHTBLUE = 9
> Public Const BRIGHTGREEN = 10
> Public Const BRIGHTCYAN = 11
> Public Const BRIGHTRED = 12
> Public Const PINK = 13
> Public Const YELLOW = 14
> Public Const WHITE = 15
>
> ' Admin Constants
> Public Const ADMIN_MONITER = 1
> Public Const ADMIN_MAPPER = 2
> Public Const ADMIN_DEVELOPER = 3
> Public 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 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)
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "new", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "networth", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "drones", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "style", RAND(0,4))
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "colony", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "people", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "ship", "repair", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "battle", "tactics", 10)
> Call putvar("/player/" & getplayername(index) & ".ini", "battle", "ion", 25)
> Call putvar("/player/" & getplayername(index) & ".ini", "dead", "map", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "dead", "x", 5)
> Call putvar("/player/" & getplayername(index) & ".ini", "dead", "y", 5)
> Call putvar("/player/" & getplayername(index) & ".ini", "player", "sprite", INT(getplayersprite(index)))
> Call putvar("/player/" & getplayername(index) & ".ini", "player", "class", 1)
> Call putvar("/player/" & getplayername(index) & ".ini", "ship", "repair", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "ship", "name", "Jump Pod")
> Call putvar("/player/" & getplayername(index) & ".ini", "skill", "engineer", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "skill", "mechanic", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "skill", "computer", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "skill", "chemist", 0)
> Call putvar("/player/" & getplayername(index) & ".ini", "skill", "refine", 0)
>
> 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("ECLIPSE/StarJumper ROCKS", YELLOW)
> End If
> End If
> End 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 If
> End Sub
>
> Sub 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 If
> End Sub
>
> Sub PlayerHit(Index, NPCNum, Damage)
> If Damage > 0 then
> Call NPCAttack(NPCNum, Index, Damage)
> End If
> End 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
> Call liftoff(index)
>
> ' Executes when any player presses the Delete key.
> Case 2
> Call statmenu(index)
> Exit Sub
> ' Executes when players press the End key.
> Case 3
>
> ' Executes when players press the PageDown key.
> Case 4
>
> End Select
> End Sub
>
> End Select
> End Sub
>
> ' Executes when something on a custom menu is clicked.
> Sub MenuScripts(Index, Clicked_Index, Menu_Type)
> Dim MenuTitle
> Dim FieldMessage
>
> Dim drone
> Dim plam
> Dim own
> Dim pmax
> Dim tot
> Dim takd
> Dim revt
> Dim yver
> Dim people
> Dim clam
> Dim pomax
> Dim pot
> Dim pakd
> Dim pevt
> Dim pver
> MenuTitle = getplayermenuclicktitle(Index)
> FieldMessage = getplayermenuclickmsg(Index)
>
> Select Case Menu_Type
> Case 1
> If MenuTitle = "Main" Then
> If Clicked_Index = 1 Then
> Call production(index)
> ElseIf Clicked_Index = 2 Then
> Call assault(index)
> ElseIf Clicked_Index = 3 Then
> Call raid(index)
> ElseIf Clicked_Index = 4 Then
> Call tactical(index)
> End If
> ElseIf MenuTitle = "Faction" Then
> If Clicked_Index = 1 Then
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", TRIM("United Worlds"))
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 1)
> Call sselect(index)
> ElseIf Clicked_Index = 2 Then
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", TRIM("Tulsar Empire"))
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 1)
> Call sselect(index)
> ElseIf Clicked_Index = 3 Then
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", TRIM("Argon Republic"))
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 1)
> Call sselect(index)
> End If
> ElseIf MenuTitle = "Special" Then
> If Clicked_Index = 1 Then
> Call Give_Currency(index, 1, 15000)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> ElseIf Clicked_Index = 2 Then
> Call Give_Currency(index, 1, 10000)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "skill", "engineer", 100)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> ElseIf Clicked_Index = 3 Then
> Call Give_Currency(index, 1, 10000)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
> call Give_Item(index, 2, 0)
> call Give_Item(index, 3, 0)
> call Give_Item(index, 4, 0)
> call Give_Item(index, 5, 0)
> call Give_Item(index, 6, 0)
> call Give_Item(index, 7, 0)
> call Give_Item(index, 8, 0)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "battle", "ion", 50)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> ElseIf Clicked_Index = 4 Then
> Call Give_Currency(index, 1, 10000)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "battle", "tactics", 8)
> call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "drones", 25)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> End If
> End If
>
> Case 2
>
> drone=getvar("/player/" & getplayername(index) & ".ini", "data", "drones")
> plam=getvar("/planet/" & getplayermap(index) & ".ini", "data", "drone")
> own=getvar("/planet/" & getplayermap(index) & ".ini", "data", "rule")
> pmax=getvar("/planet/" & getplayermap(index) & ".ini", "data", "dmax")
> tot=INT(FieldMessage)+INT(plam)
> takd=INT(drone)-INT(FieldMessage)
> revt=INT(FieldMessage)+INT(drone)
> yver=INT(plam)-INT(FieldMessage)
> people=getvar("/player/" & getplayername(index) & ".ini", "data", "people")
> clam=getvar("/planet/" & getplayermap(index) & ".ini", "data", "pop")
> pomax=getvar("/planet/" & getplayermap(index) & ".ini", "data", "pmax")
> pot=INT(FieldMessage)+INT(clam)
> pakd=INT(people)-INT(FieldMessage)
> pevt=INT(FieldMessage)+INT(people)
> pver=INT(clam)-INT(FieldMessage)
>
> If MenuTitle = "Main" Then
>
> If Clicked_Index = 1 Then
> If own=TRIM(getplayername(index)) Then
> If INT(FieldMessage) <= INT(drone) Then
> If INT(tot) <= INT(pmax) Then
> Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "drone", INT(tot))
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "drones", INT(takd))
> Call battlemsg(index, "You deposit " & INT(FieldMessage) & " Drones in your colony", GREEN, 1)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> Else
> Call battlemsg(index, "Not enough Drone Bay space", RED, 1)
> End If
> Else
> Call battlemsg(index, "You dont have that many Drones available!", RED, 1)
> End If
> Else
> Call battlemsg(index, "No colony under your control here", RED, 1)
> End If
> End If
> If Clicked_Index = 2 Then
> If own=TRIM(getplayername(index)) Then
> If INT(FieldMessage) <= INT(plam) Then
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "drones", INT(revt))
> Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "drone", INT(yver))
> Call battlemsg(index, "You collect " & INT(FieldMessage) & " Drones from your Colony", GREEN, 1)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> Else
> Call battlemsg(index, "Not enough Drones on Colony!", RED, 1)
> End If
> Else
> Call battlemsg(index, "No colony under your control here", RED, 1)
> End If
> End If
>
> If Clicked_Index = 3 Then
> If own=TRIM(getplayername(index)) Then
> If INT(FieldMessage) <= INT(people) Then
> If INT(pot) <= INT(pomax) Then
> Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "pop", INT(pot))
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "people", INT(pakd))
> Call battlemsg(index, "You deposit " & INT(FieldMessage) & " Colonists in your colony", GREEN, 1)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> Else
> Call battlemsg(index, "Not enough Biodome space", RED, 1)
> End If
> Else
> Call battlemsg(index, "You dont have that many colonists on board!", RED, 1)
> End If
> Else
> Call battlemsg(index, "No colony under your control here", RED, 1)
> End If
> End If
> If Clicked_Index = 4 Then
> If own=TRIM(getplayername(index)) Then
> If INT(FieldMessage) <= INT(clam) Then
> Call putvar("/player/" & getplayername(index) & ".ini", "data", "people", INT(pevt))
> Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "pop", INT(pver))
> Call battlemsg(index, "You collect " & INT(FieldMessage) & " colonists from your Colony", GREEN, 1)
> Call CustomMenuClose(Index)
> Call statmenu(index)
> Else
> Call battlemsg(index, "Not enough colonists on Colony!", RED, 1)
> End If
> Else
> Call battlemsg(index, "No colony under your control here", RED, 1)
> End If
> End If
>
> End If
>
> Case 3
> Call PlayerMsg(Index, "Clicked label number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW)
> End Select
> End Sub
>
> ' Executes when a player logs into the game.
> Sub JoinGame(Index)
>
> If GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "new") = 0 then
> call newac(index)
> Else
> If GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "new") = 1 Then
> call sselect(index)
> Else
> End If
> End If
>
> If GetPlayerAccess(Index) = 0 Then
> Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY)
> Else
> Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW)
> End If
>
> Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE)
>
> If LenB(MOTD) <> 0 Then
> Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN)
> End If
> Call SendWhosOnline(Index)
>
> End 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 If
> End 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)
> Dim sname
> Dim map
> Dim xloc
> Dim yloc
> Dim sprite
> Dim repair
> Dim engine
> Dim hull
> Dim ship
> Dim cmap
> Dim cxloc
> Dim cyloc
> Dim psprite
> Dim loc
> Dim mcost
> Dim power
> Dim pmath
> Dim sdata
>
> Select Case Script
> Case 0
> sname=getvar("/player/" & getplayername(index) & ".ini", "ship", "name")
> map=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "map")
> xloc=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "x")
> yloc=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "y")
> sprite=getvar("/ship/" & TRIM(sname) & ".ini", "data",  "sprite")
> repair=getvar("/player/" & Getplayername(index) & ".ini", "ship", "repair")
> engine=getvar("/ship/" & TRIM(sname) & ".ini", "data", "engine")
> hull=getvar("/ship/" & TRIM(sname) & ".ini", "data", "hull")
> ship=getvar("/ship/" & TRIM(sname) & ".ini", "data", "class")
>
> If repair=1 Then
> call setplayersprite(index, 1)
> call setplayerspeed(index, 300)
> call setplayerhp(index, 300)
> call setplayermagi(index, 100)
> call setplayermp(index, 100)
> Call SetPlayerArmorSlot(Index, 0)
> Call SetPlayerWeaponSlot(Index, 0)
> Call SetPlayerHelmetSlot(Index, 0)
> Call SetPlayerShieldSlot(Index, 0)
> Call SetPlayerNecklaceSlot(Index, 0)
> Call SetPlayerRingSlot(Index, 0)
> Call SetPlayerLegsSlot(Index, 0)
> Call setplayerclass(index, 10)
> Call sendstats(index)
> call playerwarp(index, INT(map), INT(xloc), INT(yloc))
> call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 1)
> Call battlemsg(index, "Your ship needs repair, Temporary JumpPod issued", RED, 1)
>
> Else
> Call setplayersprite(index, INT(sprite))
> call setplayerspeed(index, INT(hull))
> call setplayerhp(index, INT(hull))
> call setplayermagi(index, INT(engine))
> call setplayermp(index, INT(engine))
> Call SetPlayerArmorSlot(Index, 0)
> Call SetPlayerWeaponSlot(Index, 0)
> Call SetPlayerHelmetSlot(Index, 0)
> Call SetPlayerShieldSlot(Index, 0)
> Call SetPlayerNecklaceSlot(Index, 0)
> Call SetPlayerRingSlot(Index, 0)
> Call SetPlayerLegsSlot(Index, 0)
> Call setplayerclass(index, INT(ship))
> Call sendstats(index)
> call playerwarp(index, INT(map), INT(xloc), INT(yloc))
> call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 1)
> End If
> Exit Sub
>
> Case 1
> cmap=getvar("/loc/city/" & Getplayermap(index) & ".ini", "data", "map")
> cxloc=getvar("/loc/city/" & Getplayermap(index) & ".ini", "data", "x")
> cyloc=getvar("/loc/city/" & Getplayermap(index) & ".ini", "data", "y")
> psprite=getvar("/player/" & getplayername(index) & ".ini", "player", "sprite")
>
> Call setplayersprite(index, INT(psprite))
> Call setplayerclass(index, 1)
> Call SetPlayerArmorSlot(Index, 0)
> Call SetPlayerWeaponSlot(Index, 0)
> Call SetPlayerHelmetSlot(Index, 0)
> Call SetPlayerShieldSlot(Index, 0)
> Call SetPlayerNecklaceSlot(Index, 0)
> Call SetPlayerRingSlot(Index, 0)
> Call SetPlayerLegsSlot(Index, 0)
> Call setplayerstr(index, 10)
> call setplayerspeed(index, 50)
> call setplayerdef(index, 0)
> call setplayerhp(index, 50)
> call setplayermagi(index, 0)
> call setplayermp(index, 0)
> Call sendstats(index)
> call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 0)
> call playerwarp(index, INT(cmap), INT(cxloc), INT(cyloc))
> Exit Sub
>
> Case 2
> sdata=getvar("/player/" & getplayername(index) & ".ini", "ship", "name")
> loc=GetVar("/loc/enter/" & getplayermap(index) & ".ini", "data", "map")
> mcost=getvar("/ship/" & TRIM(sdata) & ".ini", "data", "planet")
> power=getplayermp(index)
> pmath=INT(power)-INT(mcost)
>
> If getplayermp(index) >= INT(mcost) Then
> Call playerwarp(index, INT(loc), Rand(0, 40), Rand(0, 40))
> call setplayermp(index, INT(pmath))
> Else
> Call battlemsg(index, "Your power reserves are too low", RED, 1)
> End If
> Exit Sub
>
> Case Else
> Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)
> Exit Sub
> End Select
> End 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 Select
> End 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 If
> End 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)
>
> Dim occupied
> Dim planet
> Dim gtic
> Dim ptic
> Dim atic
> Dim powner
> Dim pfac
> Dim yfac
> Dim plion
> Dim iond
> Dim plhp
> Dim dfion
> Dim pidam
>
> occupied=getvar("/planet/" & getplayermap(index) & ".ini", "data", "own")
> planet=getvar("/planet/" & getplayermap(index) & ".ini", "data", "planet")
> gtic=getvar("/planet/global.ini", "data", "tic")
> ptic=getvar("/planet/" & getplayermap(index) & ".ini", "data", "tic")
> atic=getvar("/planet/" & getplayermap(index) & ".ini", "data", "use")
> powner=getvar("/planet/" & getplayermap(index) & ".ini", "data", "rule")
> pfac=getvar("/player/" & powner & ".ini", "data", "fname")
> yfac=getvar("/player/" & getplayername(index) & ".ini", "data", "fname")
> plion=getvar("/planet/" & getplayermap(index) & ".ini", "build", "ion")
> iond=getvar("/player/" & powner & ".ini", "battle", "ion")
> plhp=getplayerhp(index)
> dfion=INT(plion*iond)
> pidam=INT(plhp)-INT(dfion)
>
> If occupied = 1 Then
> If planet = 1 Then
> If INT(gtic) > INT(ptic) Then
> Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "use", INT(atic)+INT(gtic-ptic))
> Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "tic", INT(gtic))
> Else
> End If
> Else
> End If
> If TRIM(pfac)=TRIM(yfac) Then
> Call battlemsg(index, "Incoming broadcast from Colony", WHITE, 0)
> Call battlemsg(index, "Welcome to " & Trim(powner) & "'s Colony", YELLOW, 0)
> Else
> If pidam > 0 Then
> Call battlemsg(index, "Incoming broadcast from Colony", WHITE, 0)
> Call battlemsg(index, "Leave " & Trim(powner) & "'s Colony at once!", YELLOW, 0)
> call battlemsg(index, "Your ship took " & INT(dfion) & " damage from Ion Cannons!", RED, 0)
> Call SetPlayerHP(Index, INT(pidam))
> Else
> Call battlemsg(index, "Incoming broadcast from Colony", WHITE, 0)
> Call battlemsg(index, "Leave " & Trim(powner) & "'s Colony at once!", YELLOW, 0)
> call battlemsg(index, "Your ship took " & INT(dfion) & " damage from Ion Cannons!", RED, 0)
> Call OnDeath(index)
> End If
> End If
> Else
> End If
>
> 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.
> Sub ScriptedSpell(Index, Script)
> Select Case Script
> Case 0
> Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE)
> Exit Sub
>
> Case Else
> Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE)
> Exit Sub
> End Select
> End 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 Select
> End Sub
>
> ' Executed whenever a slash command is sent to the server.
> Sub Commands(Index)
> Dim TextSay
> Dim PlayerID
> Dim MapNum
>
> ' Get the command and arguments from the cache.
> TextSay = Trim(GetVar("Scripts\Command.ini", "TEMP", "Text" & Index))
>
> ' Split the command into an array. All arguments are seperated by spaces.
> TextSay = Split(TextSay)
>
> Select Case TextSay(0)
> Case "/testscripts"
> Call TestMain(Index)
> Exit Sub
>
> Case "/help"
> Call PlayerMsg(Index, "Social Commands:", WHITE)
> Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE)
> Call PlayerMsg(Index, "-msghere = Emote Message", WHITE)
> Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE)
> Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE)
> Exit Sub
>
> Case "/calladmins"
> If GetPlayerAccess(Index) = 0 Then
> Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN)
> Else
> Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN)
> End If
> Exit Sub
>
> Case "/admin"
> If GetPlayerAccess(Index) > 0 Then
> Call PlayerMsg(Index, "Social Commands:", WHITE)
> Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE)
> Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE)
> Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE)
> End If
> Exit Sub
>
> Case "/warpmeto"
> If GetPlayerAccess(Index) > 0 Then
> PlayerID = FindPlayer(TextSay(1))
>
> If PlayerID > 0 Then
> Call PlayerWarp(Index, GetPlayerMap(PlayerID), GetPlayerX(PlayerID), GetPlayerY(PlayerID))
> Call PlayerMsg(Index, "You have been warped to " & GetPlayerName(PlayerID) & ".", BROWN)
> Else
> Call PlayerMsg(Index, "Player is not online.", WHITE)
> End If
> End If
> Exit Sub
>
> Case "/warptome"
> If GetPlayerAccess(Index) > 0 Then
> PlayerID = FindPlayer(TextSay(1))
>
> If PlayerID > 0 Then
> Call PlayerWarp(PlayerID, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
> Call PlayerMsg(PlayerID, "You have been warped to " & GetPlayerName(Index) & ".", BROWN)
> Else
> Call PlayerMsg(Index, "Player is not online.", WHITE)
> End If
> End If
> Exit Sub
>
> Case "/warpto"
> If GetPlayerAccess(Index) > 0 Then
> MapNum = TextSay(1)
>
> If MapNum > 0 And MapNum <= 400 Then
> Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index))
> Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", BRIGHTBLUE)
> Else
> Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED)
> End If
> End If
> Exit Sub
>
> Case "/test"
> Call TestMain(index)
> Exit Sub
>
> Case "/wip"
> Call working(index)
> Exit Sub
>
> Case "/addenter"
> Call addenter(index)
> Exit Sub
>
> Case "/addexit"
> Call addexit(index)
> Exit Sub
>
> Case "/addjump"
> Call jumpadd(index)
> Exit Sub
>
> Case "/addcity"
> Call addcity(index)
> Exit Sub
>
> Case "/addplanet"
> call addplanet(index)
> Exit Sub
>
> End Select
>
> Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)
> End Sub
>
> ' 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 If
> End Sub
>
> ' Executes whenever somebody dies outside of an arena.
> Sub OnDeath(Index)
>
> Call playermsg(index, "You died!", RED)
>
> End Sub
>
> ' Executes whenever a scripted item is used or double clicked.
> Sub ScriptedItem(Index, Script)
> Select Case Script
> Case 0
> Call biodome(index)
> Exit Sub
>
> Case 1
> Call extractor(index)
> Exit Sub
>
> Case 2
> Call dronebay(index)
> Exit Sub
>
> Case 3
> Call dronefac(index)
> Exit Sub
>
> Case 4
> Call research(index)
> Exit Sub
>
> Case 5
> Call ion(index)
> Exit Sub
>
> Case 6
> Call refine(index)
> Exit Sub
>
> Case 7
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Comet")
> call battlemsg(index, "New Ship-Comet", GREEN, 1)
> Call Take_Item(index, 12, 0)
> Exit Sub 
>
> Case 8
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Comet V2")
> call battlemsg(index, "New Ship-Comet V2", GREEN, 1)
> Call Take_Item(index, 13, 0)
> Exit Sub           
>
> Case 9
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Comet V3")
> call battlemsg(index, "New Ship-Comet V3", GREEN, 1)
> Call Take_Item(index, 14, 0)
> Exit Sub
>
> Case 10
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Spartan")
> call battlemsg(index, "New Ship-Spartan", GREEN, 1)
> Call Take_Item(index, 15, 0)
> Exit Sub
>
> Case 11
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Spartan Mark2")
> call battlemsg(index, "New Ship-Spartan Mark2", GREEN, 1)
> Call Take_Item(index, 16, 0)
> Exit Sub
>
> Case 12
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Spartan Mark3")
> call battlemsg(index, "New Ship-Spartan Mark3", GREEN, 1)
> Call Take_Item(index, 17, 0)
> Exit Sub
>
> Case 13
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Explorer")
> call battlemsg(index, "New Ship-Explorer", GREEN, 1)
> Call Take_Item(index, 18, 0)
> Exit Sub
>
> Case 14
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Explorer 2")
> call battlemsg(index, "New Ship-Explorer 2", GREEN, 1)
> Call Take_Item(index, 19, 0)
> Exit Sub
>
> Case 15
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Explorer 3")
> call battlemsg(index, "New Ship-Explorer 3", GREEN, 1)
> Call Take_Item(index, 20, 0)
> Exit Sub
>
> Case 16
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Falcon")
> call battlemsg(index, "New Ship-Falcon", GREEN, 1)
> Call Take_Item(index, 21, 0)
> Exit Sub
>
> Case 17
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Falcon Wing")
> call battlemsg(index, "New Ship-Falcon Wing", GREEN, 1)
> Call Take_Item(index, 22, 0)
> Exit Sub
>
> Case 18
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Falcon Claw")
> call battlemsg(index, "New Ship-Falcon Claw", GREEN, 1)
> Call Take_Item(index, 23, 0)
> Exit Sub
>
> Case 19
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Viper")
> call battlemsg(index, "New Ship-Viper", GREEN, 1)
> Call Take_Item(index, 24, 0)
> Exit Sub
>
> Case 20
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Viper X")
> call battlemsg(index, "New Ship-Viper X", GREEN, 1)
> Call Take_Item(index, 25, 0)
> Exit Sub
>
> Case 21
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Brute")
> call battlemsg(index, "New Ship-Brute", GREEN, 1)
> Call Take_Item(index, 26, 0)
> Exit Sub
>
> Case 22
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Brute III")
> call battlemsg(index, "New Ship-Brute III", GREEN, 1)
> Call Take_Item(index, 27, 0)
> Exit Sub
>
> Case 23
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Brute VI")
> call battlemsg(index, "New Ship-Brute VI", GREEN, 1)
> Call Take_Item(index, 28, 0)
> Exit Sub
>
> Case 24
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Corvette")
> call battlemsg(index, "New Ship-Corvette", GREEN, 1)
> Call Take_Item(index, 29, 0)
> Exit Sub
>
> Case 25
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "CorvetteV2")
> call battlemsg(index, "New Ship-CorvetteV2", GREEN, 1)
> Call Take_Item(index, 30, 0)
> Exit Sub
>
> Case 26
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "CorvetteV8")
> call battlemsg(index, "New Ship-CorvetteV8", GREEN, 1)
> Call Take_Item(index, 31, 0)
> Exit Sub
>
> Case 27
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Destroyer")
> call battlemsg(index, "New Ship-Destroyer", GREEN, 1)
> Call Take_Item(index, 32, 0)
> Exit Sub
>
> Case 28
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Destroyer V")
> call battlemsg(index, "New Ship-Destroyer V", GREEN, 1)
> Call Take_Item(index, 33, 0)
> Exit Sub
>
> Case 29
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Destroyer X")
> call battlemsg(index, "New Ship-Destroyer X", GREEN, 1)
> Call Take_Item(index, 34, 0)
> Exit Sub
>
> Case 30
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Pheonix")
> call battlemsg(index, "New Ship-Pheonix", GREEN, 1)
> Call Take_Item(index, 35, 0)
> Exit Sub
>
> Case 31
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Void")
> call battlemsg(index, "New Ship-Void", GREEN, 1)
> Call Take_Item(index, 36, 0)
> Exit Sub
>
> Case 32
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Demon")
> call battlemsg(index, "New Ship-Demon", GREEN, 1)
> Call Take_Item(index, 37, 0)
> Exit Sub
>
> Case 33
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Blood Wing")
> call battlemsg(index, "New Ship-Blood Wing", GREEN, 1)
> Call Take_Item(index, 38, 0)
> Exit Sub
>
> Case 34
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Nova Wing")
> call battlemsg(index, "New Ship-Nova Wing", GREEN, 1)
> Call Take_Item(index, 39, 0)
> Exit Sub
>
> Case 35
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Maxis")
> call battlemsg(index, "New Ship-Maxis", GREEN, 1)
> Call Take_Item(index, 40, 0)
> Exit Sub
>
> Case 36
> call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Teknis")
> call battlemsg(index, "New Ship-Teknis", GREEN, 1)
> Call Take_Item(index, 41, 0)
> Exit Sub
>
> Case Else
> Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)
> Exit Sub
> End Select
> End Sub
>
> ' Map Attributes
>
> Sub SetBlank(Map, X, Y)
> Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")
> End Sub
>
> Sub SetBlock(Map, X, Y)
> Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")
> End Sub
>
> Sub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY)
> Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")
> End Sub
>
> Sub SetItem(Map, X, Y, ItemID, ItemValue)
> Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")
> End Sub
>
> Sub SetNPCAvoid(Map, X, Y)
> Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")
> End Sub
>
> Sub SetKeY(Map, X, Y, KeyID, KeyTake)
> Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")
> End Sub
>
> Sub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message)
> Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")
> End Sub
>
> Sub SetHeal(Map, X, Y)
> Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")
> End Sub
>
> Sub SetKill(Map, X, Y)
> Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")
> End Sub
>
> Sub SetShop(Map, X, Y, ShopID)
> Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")
> End Sub
>
> Sub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3)
> Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")
> End Sub
>
> Sub SetArena(Map, X, Y, MapID, NewX, NewY)
> Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")
> End Sub
>
> Sub SetSound(Map, X, Y, FileName)
> Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")
> End Sub
>
> Sub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost)
> Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")
> End Sub
>
> Sub SetSign(Map, X, Y, Line1, Line2, Line3)
> Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)
> End Sub
>
> Sub SetDoor(Map, X, Y)
> Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")
> End Sub
>
> Sub SetNotice(Map, X, Y, Title, Text, FileName)
> Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)
> End Sub
>
> Sub SetScripted(Map, X, Y, Script)
> Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")
> End Sub
>
> Sub SetBank(Map, X, Y)
> Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")
> End Sub
>
> '********************************
> Function GetPlayerDirX(index)
> If GetPlayerDir(index) = 0 Then
> GetPlayerDirX = GetPlayerX(index)
> ElseIf GetPlayerDir(index) = 1 Then
> GetPlayerDirX = GetPlayerX(index)
> ElseIf GetPlayerDir(index) = 2 Then
> GetPlayerDirX = GetPlayerX(index) - 1
> ElseIf GetPlayerDir(index) = 3 Then
> GetPlayerDirX = GetPlayerX(index) + 1
> End If
> End Function
>
> 'Returns the Y of the tile in front of the player
> Function GetPlayerDirY(index)
> If GetPlayerDir(index) = 0 Then
> GetPlayerDirY = GetPlayerY(index) - 1
> ElseIf GetPlayerDir(index) = 1 Then
> GetPlayerDirY = GetPlayerY(index) + 1
> ElseIf GetPlayerDir(index) = 2 Then
> GetPlayerDirY = GetPlayerY(index)
> ElseIf GetPlayerDir(index) = 3 Then
> GetPlayerDirY = GetPlayerY(index)
> End If
> End Function
> '********************************
> Function F_CHECK_TAKE(index, number, value)
>
> Dim slot
>
> slot = 1
> F_Check_Take =0
> Do While slot < 25
> If Getplayerinvitemnum( index, Int( slot ) ) = Int( number ) Then
> If GetPlayerInvItemValue(index, Int( slot ) ) >= Int(value) Then
> F_Check_Take=1
> End If
> End If
> slot = slot + 1
> Loop
>
> End Function
> '********************************
> Sub Take_Item(index, number, value)
>
> Dim slot
> Dim taken
> Dim initial
> Dim final
>
> slot=1
> taken=0
> Do While Int(slot) < 25
> If Int(taken)=0 Then
> If Getplayerinvitemnum(index,Int(slot)) = Int(number) Then
> If Int(getplayerinvitemvalue(index, Int(slot))) >= Int(value) Then
> initial = Int(getplayerinvitemvalue(index, Int(slot) ) )
> final = Int(initial) - Int(value)
> If Int(final) <= 0 Then
> Call setplayerinvitemnum(index, Int(slot), Int(0) )
> Call setplayerinvitemvalue(index, Int(slot), Int(0) )
> Call setplayerinvitemdur(index, Int(slot), Int(0) )
> Call SendInventoryUpdate(index, Int(slot))
> taken=1
> Else
> Call setplayerinvitemvalue(index, Int(slot), Int(final) )
> Call SendInventoryUpdate(index, Int(slot) )
> taken=1
> End If
> End If
> End If
> End If
> slot = slot + 1
> Loop
> End Sub
>
> '********************************
> Sub Give_Currency(index, number, quantity)
>
> Dim slot
> Dim initial
> Dim final
> Dim given
>
> slot=1
> given=0
>
> Do While slot < 25
> If Getplayerinvitemnum(index,Int(slot))=Int(number) Then
> initial = Getplayerinvitemvalue( index, Int( slot ) )
> final = Int( initial ) + Int( quantity )
> Call setplayerinvitemvalue( index, Int( slot ), Int( final ) )
> Call SendInventoryUpdate(index, Int(slot) )
> slot = 25
> given = 1
> End If
> slot = slot + 1
> Loop
>
> If given=1 Then
> slot=25
> Else
> slot=1
> End If
>
> Do While slot < 25
> If Getplayerinvitemnum(index,Int(slot)) = 0 Then
> Call SetPlayerInvItemNum(index, Int( slot ), Int( number ) )
> Call SetPlayerInvItemValue(index, Int( slot ), Int( quantity ) )
> Call SetPlayerInvItemDur(index, Int( slot ), 0 )
> Call SendInventoryUpdate(index, Int(slot) )
> slot = 25
> End If
> slot = slot + 1
> Loop
>
> End Sub
> '********************************
> Sub Give_Item(index, number, durability)
> Dim slot
>
> slot = 1
> Do While slot < 25
> If Getplayerinvitemnum( index, Int( slot ) ) = 0 Then
> Call SetPlayerInvItemNum(index, Int( slot ), Int( number ) )
> Call SetPlayerInvItemDur(index, Int( slot ), Int( durability ) )
> Call SetPlayerInvItemValue(index, Int( slot ), Int(0) )
> Call SendInventoryUpdate(index, Int(slot) )
> slot = 25
> End If
> slot = slot + 1
> Loop
> End Sub
> '********************************
> Dim new
> new=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "new")
> If new = 0 then
>
> Sub sselect(index)
> Call CustomMenuShow(index, "Special", "\GUI\CUSTOM\sselect.bmp", 0)
> Call CustomMenuPicture(index, 1, "\GUI\CUSTOM\merchant.bmp", 37, 19)
> Call CustomMenuPicture(index, 2, "\GUI\CUSTOM\engineer.bmp", 37, 111)
> Call CustomMenuPicture(index, 3, "\GUI\CUSTOM\explore.bmp", 37, 203)
> Call CustomMenuPicture(index, 4, "\GUI\CUSTOM\captain.bmp", 37, 295)
> End Sub
>
> Sub newac(index)
> Call CustomMenuShow(index, "Faction", "\GUI\CUSTOM\fselect.bmp", 0)
> Call CustomMenuPicture(index, 1, "\GUI\CUSTOM\UW.bmp", 47, 28)
> Call CustomMenuPicture(index, 2, "\GUI\CUSTOM\TE.bmp", 47, 118)
> Call CustomMenuPicture(index, 3, "\GUI\CUSTOM\AR.bmp", 47, 208)
> End Sub
>
> Sub statmenu(index)
> Dim yfac
> Dim sname
> Dim ycols
> Dim yournet
> Dim drns
> Dim peop
> Dim coords
>
> yfac=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "fname")
> sname=GetVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name")
> ycols=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "colony")
> yournet=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "networth")
> drns=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "drones")
> peop=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "people")
> coords=GetVar("/loc/location.ini", "data", getplayermap(index))
>
> Call CustomMenuShow(index, "Main", "\GUI\CUSTOM\menu.bmp", 1)
> Call CustomMenuPicture(index, 1, "\GUI\CUSTOM\" & TRIM(sname) & ".bmp", 26, 18)
> Call CustomMenuLabel(index, 1, "" & TRIM(yfac) & "", 85, 19, 7, 15, 0, 400, 20)
> Call CustomMenuLabel(index, 2, "" & TRIM(sname) & "", 8, 58, 7, 15, 0, 400, 20)
> Call CustomMenuLabel(index, 3, "" & INT(ycols) & "", 218, 48, 7, 15, 0, 400, 20)
> Call CustomMenuLabel(index, 4, "" & INT(yournet) & "", 85, 38, 7, 15, 0, 400, 20)
> Call CustomMenuLabel(index, 5, "" & INT(drns) & "", 222, 20, 7, 15, 0, 400, 20)
> Call CustomMenuLabel(index, 6, "" & INT(peop) & "", 280, 48, 7, 15, 0, 400, 20)
> Call CustomMenuPicture(index, 1, "\GUI\CUSTOM\production.bmp", 12, 86)
> Call CustomMenuPicture(index, 2, "\GUI\CUSTOM\assault.bmp", 12, 141)
> Call CustomMenuPicture(index, 3, "\GUI\CUSTOM\raid.bmp", 13, 165)
> Call CustomMenuPicture(index, 4, "\GUI\CUSTOM\tactical.bmp", 13, 189)
> Call CustomMenuTextBox(index, 1, 75, 215, 93, "0")
> Call CustomMenuTextBox(index, 2, 75, 306, 93, "0")
> Call CustomMenuTextBox(index, 3, 75, 215, 142, "0")
> Call CustomMenuTextBox(index, 4, 75, 306, 142, "0")
> Call CustomMenuLabel(index, 7, "" & INT(coords) & "", 85, 55, 7, 15, 0, 400, 20)
> End Sub
>
> Sub addcity(index)
> If GetPlayerAccess(index) > 3 Then
> Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "map", 0)
> Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "x", 0)
> Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "y", 0)
> call playermsg(index, "Enter Added", RED)
> Else
> Call playermsg(index, "What are you trying to do??", RED)
> End If
> End Sub
>
> Sub addenter(index)
> If GetPlayerAccess(index) > 3 Then
> Call PutVar("/loc/enter/" & Getplayermap(index) & ".ini", "data", "map", 0)
> call playermsg(index, "Enter Added", RED)
> Else
> Call playermsg(index, "What are you trying to do??", RED)
> End If
> End Sub
>
> Sub addexit(index)
> If GetPlayerAccess(index) > 3 Then
> Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "map", 0)
> Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "x", 0)
> Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "y", 0)
> call playermsg(index, "Exit Added to TEMP", RED)
> Else
> call playermsg(index, "What are you trying to do??", RED)
> End If
> End Sub
>
> Sub jumpadd(index)
> Dim num
> Dim map
> Dim edit
> Dim lnum
> Dim ledit
> num=GetVar("/loc/coords.ini", "data", "max")
> map=Getplayermap(index)
> edit=INT(num)+1
> lnum=GetVar("/loc/location.ini", "data", "max")
> ledit=INT(lnum)+1
> If GetPlayerAccess(index) > 3 Then
> Call PutVar("/loc/coords.ini", "data", "" & INT(num) & "", INT(map))
> Call PutVar("/loc/coords.ini", "data", "max", INT(edit))
> Call PutVar("/loc/location.ini", "data", "" & INT(map) & "", INT(lnum))
> Call PutVar("/loc/location.ini", "data", "max", INT(ledit))
> Call playermsg(index, "Jump Coords Added", RED)
> Else
> call playermsg(index, "What are you trying to do??", RED)
> End If
> End Sub
>
> Sub addplanet(index)
> If GetPlayerAccess(index) > 3 Then
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "rule", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "own", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "pop", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "pmax", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "tic", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "use", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "planet", 1)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "drone", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "dmax", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "resource", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "ref", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "bio", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "resh", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "extract", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "dronefac", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "dronebay", 0)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "ion", 0)
> Call playermsg(index, "Planet added", GREEN)
> Else
> call playermsg(index, "What are you trying to do??", RED)
> End If
> End Sub
>
> Sub liftoff(index)
> Dim sname
> Dim map
> Dim xloc
> Dim yloc
> Dim mcost
> Dim power
> Dim pmath
>
> sname=getvar("/player/" & getplayername(index) & ".ini", "ship", "name")
> map=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "map")
> xloc=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "x")
> yloc=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "y")
> mcost=getvar("/ship/" & TRIM(sname) & ".ini", "data", "planet")
> power=getplayermp(index)
> pmath=INT(power)-INT(mcost)
>
> If getplayermp(index) >= INT(mcost) Then
> Call playerwarp(index, INT(map), INT(xloc), INT(yloc))
> call setplayermp(index, INT(pmath))
> Else
> Call battlemsg(index, "Your power reserves are too low", RED, 1)
> End If
>
> End Sub
>
> '*Build Biodome
> Sub biodome(index)
> Dim occu
> Dim chkyou
> Dim planet
> Dim style
> Dim atype
> Dim pmax
> Dim bio
> Dim worth
> Dim newc
>
> occu=getvar("/planet/" & getplayermap(index) & ".ini", "data", "own")
> chkyou=getvar("/planet/" & getplayermap(index) & ".ini", "data", "rule")
> planet=getvar("/planet/" & getplayermap(index) & ".ini", "data", "planet")
> style=getvar("/player/" & getplayername(index) & ".ini", "data", "style")
> atype=getattribute(getplayermap(index), getplayerx(index), getplayery(index))
> pmax=getvar("/planet/" & getplayermap(index) & ".ini", "data", "pmax")
> bio=getvar("/planet/" & getplayermap(index) & ".ini", "build", "bio")
> worth=getvar("/player/" & getplayername(index) & ".ini", "data", "networth")
> newc=getvar("/player/" & getplayername(index) & ".ini", "data", "colony")
>
> If planet=1 Then
> If occu=0 Or chkyou=TRIM(getplayername(index)) Then
> If atype=0 Then
> call SetTile(getplayermap(index), getplayerx(index), getplayery(index), INT(style), 5, 8, 3)
> call putvar("/planet/" & getplayermap(index) & ".ini", "data", "pmax", INT(pmax)+10)
> call putvar("/planet/" & getplayermap(index) & ".ini", "build", "bio", INT(bio)+1)
> Call SetNPCAvoid(getplayermap(index), getplayerx(index), getplayery(index))
> Call battlemsg(index, "Biodome Constructed", YELLOW, 1)
> Call Take_Item(index, 2, 0)
> Call SendInventory(Index)
> call putvar("/player/" & getplayername(index) & ".ini", "data", "networth", INT(worth)+100)
> If occu=0 Then
> Call putvar("/planet/" &a
Link to comment
Share on other sites

  • 2 weeks later...
' Eclipse Evolution 2.7 Scripting File

' Global Variables
Public GameName
Public MAX_MAPS
Public MOTD

' Color Constants
Public Const BLACK = 0
Public Const BLUE = 1
Public Const GREEN = 2
Public Const CYAN = 3
Public Const RED = 4
Public Const MAGENTA = 5
Public Const BROWN = 6
Public Const GREY = 7
Public Const DARKGREY = 8
Public Const BRIGHTBLUE = 9
Public Const BRIGHTGREEN = 10
Public Const BRIGHTCYAN = 11
Public Const BRIGHTRED = 12
Public Const PINK = 13
Public Const YELLOW = 14
Public Const WHITE = 15

' Admin Constants
Public Const ADMIN_MONITER = 1
Public Const ADMIN_MAPPER = 2
Public Const ADMIN_DEVELOPER = 3
Public 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 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)
Call putvar("/player/" & getplayername(index) & ".ini", "data", "new", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "data", "networth", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "data", "drones", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "data", "style", RAND(0,4))
Call putvar("/player/" & getplayername(index) & ".ini", "data", "colony", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "data", "people", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "ship", "repair", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "battle", "tactics", 10)
Call putvar("/player/" & getplayername(index) & ".ini", "battle", "ion", 25)
Call putvar("/player/" & getplayername(index) & ".ini", "dead", "map", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "dead", "x", 5)
Call putvar("/player/" & getplayername(index) & ".ini", "dead", "y", 5)
Call putvar("/player/" & getplayername(index) & ".ini", "player", "sprite", INT(getplayersprite(index)))
Call putvar("/player/" & getplayername(index) & ".ini", "player", "class", 1)
Call putvar("/player/" & getplayername(index) & ".ini", "ship", "repair", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "ship", "name", "Jump Pod")
Call putvar("/player/" & getplayername(index) & ".ini", "skill", "engineer", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "skill", "mechanic", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "skill", "computer", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "skill", "chemist", 0)
Call putvar("/player/" & getplayername(index) & ".ini", "skill", "refine", 0)

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("ECLIPSE/StarJumper ROCKS", YELLOW)
      End If
  End If
End 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 If
End Sub

Sub 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 If
End Sub

Sub PlayerHit(Index, NPCNum, Damage)
  If Damage > 0 then
      Call NPCAttack(NPCNum, Index, Damage)
  End If
End 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
Call liftoff(index)

      ' Executes when any player presses the Delete key.
      Case 2
Call statmenu(index)
Exit Sub
      ' Executes when players press the End key.
      Case 3

      ' Executes when players press the PageDown key.
      Case 4

  End Select
End Sub

End Select
End Sub

' Executes when something on a custom menu is clicked.
Sub MenuScripts(Index, Clicked_Index, Menu_Type)
  Dim MenuTitle
  Dim FieldMessage

Dim drone
Dim plam
Dim own
Dim pmax
Dim tot
Dim takd
Dim revt
Dim yver
Dim people
Dim clam
Dim pomax
Dim pot
Dim pakd
Dim pevt
Dim pver
  MenuTitle = getplayermenuclicktitle(Index)
  FieldMessage = getplayermenuclickmsg(Index)

  Select Case Menu_Type
      Case 1
If MenuTitle = "Main" Then
If Clicked_Index = 1 Then
Call production(index)
ElseIf Clicked_Index = 2 Then
Call assault(index)
ElseIf Clicked_Index = 3 Then
Call raid(index)
ElseIf Clicked_Index = 4 Then
Call tactical(index)
End If
ElseIf MenuTitle = "Faction" Then
If Clicked_Index = 1 Then
Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", TRIM("United Worlds"))
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 1)
Call sselect(index)
ElseIf Clicked_Index = 2 Then
Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", TRIM("Tulsar Empire"))
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 1)
Call sselect(index)
ElseIf Clicked_Index = 3 Then
Call putvar("/player/" & getplayername(index) & ".ini", "data", "fname", TRIM("Argon Republic"))
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 1)
Call sselect(index)
End If
ElseIf MenuTitle = "Special" Then
If Clicked_Index = 1 Then
Call Give_Currency(index, 1, 15000)
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
Call CustomMenuClose(Index)
Call statmenu(index)
ElseIf Clicked_Index = 2 Then
Call Give_Currency(index, 1, 10000)
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
call putVar("/player/" & GetPlayerName(index) & ".ini", "skill", "engineer", 100)
Call CustomMenuClose(Index)
Call statmenu(index)
ElseIf Clicked_Index = 3 Then
Call Give_Currency(index, 1, 10000)
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
call Give_Item(index, 2, 0)
call Give_Item(index, 3, 0)
call Give_Item(index, 4, 0)
call Give_Item(index, 5, 0)
call Give_Item(index, 6, 0)
call Give_Item(index, 7, 0)
call Give_Item(index, 8, 0)
call putVar("/player/" & GetPlayerName(index) & ".ini", "battle", "ion", 50)
Call CustomMenuClose(Index)
Call statmenu(index)
ElseIf Clicked_Index = 4 Then
Call Give_Currency(index, 1, 10000)
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "new", 2)
call putVar("/player/" & GetPlayerName(index) & ".ini", "battle", "tactics", 8)
call putVar("/player/" & GetPlayerName(index) & ".ini", "data", "drones", 25)
Call CustomMenuClose(Index)
Call statmenu(index)
End If
End If

      Case 2

drone=getvar("/player/" & getplayername(index) & ".ini", "data", "drones")       
plam=getvar("/planet/" & getplayermap(index) & ".ini", "data", "drone")
own=getvar("/planet/" & getplayermap(index) & ".ini", "data", "rule")
pmax=getvar("/planet/" & getplayermap(index) & ".ini", "data", "dmax")
tot=INT(FieldMessage)+INT(plam)
takd=INT(drone)-INT(FieldMessage)
revt=INT(FieldMessage)+INT(drone)
yver=INT(plam)-INT(FieldMessage)
people=getvar("/player/" & getplayername(index) & ".ini", "data", "people")
clam=getvar("/planet/" & getplayermap(index) & ".ini", "data", "pop")
pomax=getvar("/planet/" & getplayermap(index) & ".ini", "data", "pmax")
pot=INT(FieldMessage)+INT(clam)
pakd=INT(people)-INT(FieldMessage)
pevt=INT(FieldMessage)+INT(people)
pver=INT(clam)-INT(FieldMessage)

If MenuTitle = "Main" Then

If Clicked_Index = 1 Then
If own=TRIM(getplayername(index)) Then
If INT(FieldMessage) <= INT(drone) Then
If INT(tot) <= INT(pmax) Then
Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "drone", INT(tot))
Call putvar("/player/" & getplayername(index) & ".ini", "data", "drones", INT(takd))
Call battlemsg(index, "You deposit " & INT(FieldMessage) & " Drones in your colony", GREEN, 1)
Call CustomMenuClose(Index)
Call statmenu(index)
Else
Call battlemsg(index, "Not enough Drone Bay space", RED, 1)
End If
Else
Call battlemsg(index, "You dont have that many Drones available!", RED, 1)
End If
Else
Call battlemsg(index, "No colony under your control here", RED, 1)
End If
End If
If Clicked_Index = 2 Then
If own=TRIM(getplayername(index)) Then
If INT(FieldMessage) <= INT(plam) Then
Call putvar("/player/" & getplayername(index) & ".ini", "data", "drones", INT(revt))
Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "drone", INT(yver))
Call battlemsg(index, "You collect " & INT(FieldMessage) & " Drones from your Colony", GREEN, 1)
Call CustomMenuClose(Index)
Call statmenu(index)
Else
Call battlemsg(index, "Not enough Drones on Colony!", RED, 1)
End If
Else
Call battlemsg(index, "No colony under your control here", RED, 1)
End If
End If

If Clicked_Index = 3 Then
If own=TRIM(getplayername(index)) Then
If INT(FieldMessage) <= INT(people) Then
If INT(pot) <= INT(pomax) Then
Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "pop", INT(pot))
Call putvar("/player/" & getplayername(index) & ".ini", "data", "people", INT(pakd))
Call battlemsg(index, "You deposit " & INT(FieldMessage) & " Colonists in your colony", GREEN, 1)
Call CustomMenuClose(Index)
Call statmenu(index)
Else
Call battlemsg(index, "Not enough Biodome space", RED, 1)
End If
Else
Call battlemsg(index, "You dont have that many colonists on board!", RED, 1)
End If
Else
Call battlemsg(index, "No colony under your control here", RED, 1)
End If
End If
If Clicked_Index = 4 Then
If own=TRIM(getplayername(index)) Then
If INT(FieldMessage) <= INT(clam) Then
Call putvar("/player/" & getplayername(index) & ".ini", "data", "people", INT(pevt))
Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "pop", INT(pver))
Call battlemsg(index, "You collect " & INT(FieldMessage) & " colonists from your Colony", GREEN, 1)
Call CustomMenuClose(Index)
Call statmenu(index)
Else
Call battlemsg(index, "Not enough colonists on Colony!", RED, 1)
End If
Else
Call battlemsg(index, "No colony under your control here", RED, 1)
End If
End If

End If

      Case 3
        Call PlayerMsg(Index, "Clicked label number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW)
  End Select
End Sub

' Executes when a player logs into the game.
Sub JoinGame(Index)

If GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "new") = 0 then
call newac(index)
Else
If GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "new") = 1 Then
call sselect(index)
Else
End If
End If

If GetPlayerAccess(Index) = 0 Then
      Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY)
  Else
      Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW)
  End If

  Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE)

  If LenB(MOTD) <> 0 Then
      Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN)
  End If
Call SendWhosOnline(Index)

End 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 If
End 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)
Dim sname
Dim map
Dim xloc
Dim yloc
Dim sprite
Dim repair
Dim engine
Dim hull
Dim ship
Dim cmap
Dim cxloc
Dim cyloc
Dim psprite
Dim loc
Dim mcost
Dim power
Dim pmath
Dim sdata

Select Case Script
      Case 0
sname=getvar("/player/" & getplayername(index) & ".ini", "ship", "name")
map=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "map")
xloc=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "x")
yloc=getvar("/loc/exit/" & Getplayermap(index) & ".ini", "data", "y")
sprite=getvar("/ship/" & TRIM(sname) & ".ini", "data",  "sprite")
repair=getvar("/player/" & Getplayername(index) & ".ini", "ship", "repair")
engine=getvar("/ship/" & TRIM(sname) & ".ini", "data", "engine")
hull=getvar("/ship/" & TRIM(sname) & ".ini", "data", "hull")
ship=getvar("/ship/" & TRIM(sname) & ".ini", "data", "class")

If repair=1 Then
call setplayersprite(index, 1)
call setplayerspeed(index, 300)
call setplayerhp(index, 300)
call setplayermagi(index, 100)
call setplayermp(index, 100)
Call SetPlayerArmorSlot(Index, 0)
Call SetPlayerWeaponSlot(Index, 0)
Call SetPlayerHelmetSlot(Index, 0)
Call SetPlayerShieldSlot(Index, 0)
Call SetPlayerNecklaceSlot(Index, 0)
Call SetPlayerRingSlot(Index, 0)
Call SetPlayerLegsSlot(Index, 0)
Call setplayerclass(index, 10)
Call sendstats(index)
call playerwarp(index, INT(map), INT(xloc), INT(yloc))
call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 1)
Call battlemsg(index, "Your ship needs repair, Temporary JumpPod issued", RED, 1)

Else
Call setplayersprite(index, INT(sprite))
call setplayerspeed(index, INT(hull))
call setplayerhp(index, INT(hull))
call setplayermagi(index, INT(engine))
call setplayermp(index, INT(engine))
Call SetPlayerArmorSlot(Index, 0)
Call SetPlayerWeaponSlot(Index, 0)
Call SetPlayerHelmetSlot(Index, 0)
Call SetPlayerShieldSlot(Index, 0)
Call SetPlayerNecklaceSlot(Index, 0)
Call SetPlayerRingSlot(Index, 0)
Call SetPlayerLegsSlot(Index, 0)
Call setplayerclass(index, INT(ship))
Call sendstats(index)
call playerwarp(index, INT(map), INT(xloc), INT(yloc))
call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 1)
End If
Exit Sub

Case 1
cmap=getvar("/loc/city/" & Getplayermap(index) & ".ini", "data", "map")
cxloc=getvar("/loc/city/" & Getplayermap(index) & ".ini", "data", "x")
cyloc=getvar("/loc/city/" & Getplayermap(index) & ".ini", "data", "y")
psprite=getvar("/player/" & getplayername(index) & ".ini", "player", "sprite")

Call setplayersprite(index, INT(psprite))
Call setplayerclass(index, 1)
Call SetPlayerArmorSlot(Index, 0)
Call SetPlayerWeaponSlot(Index, 0)
Call SetPlayerHelmetSlot(Index, 0)
Call SetPlayerShieldSlot(Index, 0)
Call SetPlayerNecklaceSlot(Index, 0)
Call SetPlayerRingSlot(Index, 0)
Call SetPlayerLegsSlot(Index, 0)
Call setplayerstr(index, 10)
call setplayerspeed(index, 50)
call setplayerdef(index, 0)
call setplayerhp(index, 50)
call setplayermagi(index, 0)
call setplayermp(index, 0)
Call sendstats(index)
call putvar("/player/" & getplayername(index) & ".ini", "data", "mode", 0)
call playerwarp(index, INT(cmap), INT(cxloc), INT(cyloc))
Exit Sub

Case 2
sdata=getvar("/player/" & getplayername(index) & ".ini", "ship", "name")
loc=GetVar("/loc/enter/" & getplayermap(index) & ".ini", "data", "map")
mcost=getvar("/ship/" & TRIM(sdata) & ".ini", "data", "planet")
power=getplayermp(index)
pmath=INT(power)-INT(mcost)

If getplayermp(index) >= INT(mcost) Then
Call playerwarp(index, INT(loc), Rand(0, 40), Rand(0, 40))
call setplayermp(index, INT(pmath))
Else
Call battlemsg(index, "Your power reserves are too low", RED, 1)
End If
Exit Sub

      Case Else
        Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)
        Exit Sub
  End Select
End 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 Select
End 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 If
End 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)

Dim occupied
Dim planet
Dim gtic
Dim ptic
Dim atic
Dim powner
Dim pfac
Dim yfac
Dim plion
Dim iond
Dim plhp
Dim dfion
Dim pidam

occupied=getvar("/planet/" & getplayermap(index) & ".ini", "data", "own")
planet=getvar("/planet/" & getplayermap(index) & ".ini", "data", "planet")
gtic=getvar("/planet/global.ini", "data", "tic")
ptic=getvar("/planet/" & getplayermap(index) & ".ini", "data", "tic")
atic=getvar("/planet/" & getplayermap(index) & ".ini", "data", "use")
powner=getvar("/planet/" & getplayermap(index) & ".ini", "data", "rule")
pfac=getvar("/player/" & powner & ".ini", "data", "fname")
yfac=getvar("/player/" & getplayername(index) & ".ini", "data", "fname")
plion=getvar("/planet/" & getplayermap(index) & ".ini", "build", "ion")
iond=getvar("/player/" & powner & ".ini", "battle", "ion")
plhp=getplayerhp(index)
dfion=INT(plion*iond)
pidam=INT(plhp)-INT(dfion)

If occupied = 1 Then
If planet = 1 Then
If INT(gtic) > INT(ptic) Then
Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "use", INT(atic)+INT(gtic-ptic))
Call putvar("/planet/" & getplayermap(index) & ".ini", "data", "tic", INT(gtic))
Else
End If
Else
End If
If TRIM(pfac)=TRIM(yfac) Then
Call battlemsg(index, "Incoming broadcast from Colony", WHITE, 0)
Call battlemsg(index, "Welcome to " & Trim(powner) & "'s Colony", YELLOW, 0)
Else
If pidam > 0 Then
Call battlemsg(index, "Incoming broadcast from Colony", WHITE, 0)
Call battlemsg(index, "Leave " & Trim(powner) & "'s Colony at once!", YELLOW, 0)
call battlemsg(index, "Your ship took " & INT(dfion) & " damage from Ion Cannons!", RED, 0)
Call SetPlayerHP(Index, INT(pidam))
Else
Call battlemsg(index, "Incoming broadcast from Colony", WHITE, 0)
Call battlemsg(index, "Leave " & Trim(powner) & "'s Colony at once!", YELLOW, 0)
call battlemsg(index, "Your ship took " & INT(dfion) & " damage from Ion Cannons!", RED, 0)
Call OnDeath(index)
End If
End If
Else
End If

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.
Sub ScriptedSpell(Index, Script)
  Select Case Script
      Case 0
        Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE)
        Exit Sub

      Case Else
        Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE)
        Exit Sub
  End Select
End 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 Select
End Sub

' Executed whenever a slash command is sent to the server.
Sub Commands(Index)
  Dim TextSay
  Dim PlayerID
  Dim MapNum

  ' Get the command and arguments from the cache.
  TextSay = Trim(GetVar("ScriptsCommand.ini", "TEMP", "Text" & Index))

  ' Split the command into an array. All arguments are seperated by spaces.
  TextSay = Split(TextSay)

  Select Case TextSay(0)
      Case "/testscripts"
        Call TestMain(Index)
        Exit Sub

      Case "/help"
        Call PlayerMsg(Index, "Social Commands:", WHITE)
        Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE)
        Call PlayerMsg(Index, "-msghere = Emote Message", WHITE)
        Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE)
        Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE)
        Exit Sub 

      Case "/calladmins"
        If GetPlayerAccess(Index) = 0 Then
            Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN)
        Else
            Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN)
        End If
        Exit Sub 

      Case "/admin"
        If GetPlayerAccess(Index) > 0 Then
            Call PlayerMsg(Index, "Social Commands:", WHITE)
            Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE)
            Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE)
            Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE)
        End If
        Exit Sub

      Case "/warpmeto"
        If GetPlayerAccess(Index) > 0 Then
            PlayerID = FindPlayer(TextSay(1))

            If PlayerID > 0 Then
              Call PlayerWarp(Index, GetPlayerMap(PlayerID), GetPlayerX(PlayerID), GetPlayerY(PlayerID))
              Call PlayerMsg(Index, "You have been warped to " & GetPlayerName(PlayerID) & ".", BROWN)
            Else
              Call PlayerMsg(Index, "Player is not online.", WHITE)
            End If
        End If
        Exit Sub

      Case "/warptome"
        If GetPlayerAccess(Index) > 0 Then
            PlayerID = FindPlayer(TextSay(1))

            If PlayerID > 0 Then
              Call PlayerWarp(PlayerID, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
              Call PlayerMsg(PlayerID, "You have been warped to " & GetPlayerName(Index) & ".", BROWN)
            Else
              Call PlayerMsg(Index, "Player is not online.", WHITE)
            End If
        End If
        Exit Sub

      Case "/warpto"
        If GetPlayerAccess(Index) > 0 Then
            MapNum = TextSay(1)

            If MapNum > 0 And MapNum <= 400 Then
              Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index))
              Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", BRIGHTBLUE)
            Else
              Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED)
            End If
        End If
        Exit Sub

Case "/test"
Call TestMain(index)
Exit Sub

Case "/wip"
Call working(index)
Exit Sub

Case "/addenter"
Call addenter(index)
Exit Sub

Case "/addexit"
Call addexit(index)
Exit Sub

Case "/addjump"
Call jumpadd(index)
Exit Sub

Case "/addcity"
Call addcity(index)
Exit Sub

Case "/addplanet"
call addplanet(index)
Exit Sub

  End Select

  Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)
End Sub

' 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 If
End Sub

' Executes whenever somebody dies outside of an arena.
Sub OnDeath(Index)

Call playermsg(index, "You died!", RED)

End Sub

' Executes whenever a scripted item is used or double clicked.
Sub ScriptedItem(Index, Script)
  Select Case Script
      Case 0
        Call biodome(index)
        Exit Sub

      Case 1
        Call extractor(index)
        Exit Sub

      Case 2
        Call dronebay(index)
        Exit Sub

      Case 3
        Call dronefac(index)
        Exit Sub

      Case 4
        Call research(index)
        Exit Sub

      Case 5
        Call ion(index)
        Exit Sub

      Case 6
        Call refine(index)
        Exit Sub

Case 7
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Comet")
call battlemsg(index, "New Ship-Comet", GREEN, 1)
Call Take_Item(index, 12, 0)
Exit Sub 

Case 8
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Comet V2")
call battlemsg(index, "New Ship-Comet V2", GREEN, 1)
Call Take_Item(index, 13, 0)
Exit Sub           

Case 9
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Comet V3")
call battlemsg(index, "New Ship-Comet V3", GREEN, 1)
Call Take_Item(index, 14, 0)
Exit Sub

Case 10
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Spartan")
call battlemsg(index, "New Ship-Spartan", GREEN, 1)
Call Take_Item(index, 15, 0)
Exit Sub

Case 11
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Spartan Mark2")
call battlemsg(index, "New Ship-Spartan Mark2", GREEN, 1)
Call Take_Item(index, 16, 0)
Exit Sub

Case 12
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Spartan Mark3")
call battlemsg(index, "New Ship-Spartan Mark3", GREEN, 1)
Call Take_Item(index, 17, 0)
Exit Sub

Case 13
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Explorer")
call battlemsg(index, "New Ship-Explorer", GREEN, 1)
Call Take_Item(index, 18, 0)
Exit Sub

Case 14
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Explorer 2")
call battlemsg(index, "New Ship-Explorer 2", GREEN, 1)
Call Take_Item(index, 19, 0)
Exit Sub

Case 15
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Explorer 3")
call battlemsg(index, "New Ship-Explorer 3", GREEN, 1)
Call Take_Item(index, 20, 0)
Exit Sub

Case 16
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Falcon")
call battlemsg(index, "New Ship-Falcon", GREEN, 1)
Call Take_Item(index, 21, 0)
Exit Sub

Case 17
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Falcon Wing")
call battlemsg(index, "New Ship-Falcon Wing", GREEN, 1)
Call Take_Item(index, 22, 0)
Exit Sub

Case 18
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Falcon Claw")
call battlemsg(index, "New Ship-Falcon Claw", GREEN, 1)
Call Take_Item(index, 23, 0)
Exit Sub

Case 19
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Viper")
call battlemsg(index, "New Ship-Viper", GREEN, 1)
Call Take_Item(index, 24, 0)
Exit Sub

Case 20
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Viper X")
call battlemsg(index, "New Ship-Viper X", GREEN, 1)
Call Take_Item(index, 25, 0)
Exit Sub

Case 21
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Brute")
call battlemsg(index, "New Ship-Brute", GREEN, 1)
Call Take_Item(index, 26, 0)
Exit Sub

Case 22
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Brute III")
call battlemsg(index, "New Ship-Brute III", GREEN, 1)
Call Take_Item(index, 27, 0)
Exit Sub

Case 23
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Brute VI")
call battlemsg(index, "New Ship-Brute VI", GREEN, 1)
Call Take_Item(index, 28, 0)
Exit Sub

Case 24
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Corvette")
call battlemsg(index, "New Ship-Corvette", GREEN, 1)
Call Take_Item(index, 29, 0)
Exit Sub

Case 25
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "CorvetteV2")
call battlemsg(index, "New Ship-CorvetteV2", GREEN, 1)
Call Take_Item(index, 30, 0)
Exit Sub

Case 26
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "CorvetteV8")
call battlemsg(index, "New Ship-CorvetteV8", GREEN, 1)
Call Take_Item(index, 31, 0)
Exit Sub

Case 27
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Destroyer")
call battlemsg(index, "New Ship-Destroyer", GREEN, 1)
Call Take_Item(index, 32, 0)
Exit Sub

Case 28
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Destroyer V")
call battlemsg(index, "New Ship-Destroyer V", GREEN, 1)
Call Take_Item(index, 33, 0)
Exit Sub

Case 29
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Destroyer X")
call battlemsg(index, "New Ship-Destroyer X", GREEN, 1)
Call Take_Item(index, 34, 0)
Exit Sub

Case 30
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Pheonix")
call battlemsg(index, "New Ship-Pheonix", GREEN, 1)
Call Take_Item(index, 35, 0)
Exit Sub

Case 31
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Void")
call battlemsg(index, "New Ship-Void", GREEN, 1)
Call Take_Item(index, 36, 0)
Exit Sub

Case 32
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Demon")
call battlemsg(index, "New Ship-Demon", GREEN, 1)
Call Take_Item(index, 37, 0)
Exit Sub

Case 33
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Blood Wing")
call battlemsg(index, "New Ship-Blood Wing", GREEN, 1)
Call Take_Item(index, 38, 0)
Exit Sub

Case 34
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Nova Wing")
call battlemsg(index, "New Ship-Nova Wing", GREEN, 1)
Call Take_Item(index, 39, 0)
Exit Sub

Case 35
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Maxis")
call battlemsg(index, "New Ship-Maxis", GREEN, 1)
Call Take_Item(index, 40, 0)
Exit Sub

Case 36
call putVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name", "Teknis")
call battlemsg(index, "New Ship-Teknis", GREEN, 1)
Call Take_Item(index, 41, 0)
Exit Sub

Case Else
        Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)
        Exit Sub
  End Select
End Sub

' Map Attributes

Sub SetBlank(Map, X, Y)
  Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")
End Sub

Sub SetBlock(Map, X, Y)
  Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")
End Sub

Sub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY)
  Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")
End Sub

Sub SetItem(Map, X, Y, ItemID, ItemValue)
  Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")
End Sub

Sub SetNPCAvoid(Map, X, Y)
  Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")
End Sub

Sub SetKeY(Map, X, Y, KeyID, KeyTake)
  Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")
End Sub

Sub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message)
  Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")
End Sub

Sub SetHeal(Map, X, Y)
  Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")
End Sub

Sub SetKill(Map, X, Y)
  Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")
End Sub

Sub SetShop(Map, X, Y, ShopID)
  Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")
End Sub

Sub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3)
  Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")
End Sub

Sub SetArena(Map, X, Y, MapID, NewX, NewY)
  Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")
End Sub

Sub SetSound(Map, X, Y, FileName)
  Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")
End Sub

Sub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost)
  Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")
End Sub

Sub SetSign(Map, X, Y, Line1, Line2, Line3)
  Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)
End Sub

Sub SetDoor(Map, X, Y)
  Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")
End Sub

Sub SetNotice(Map, X, Y, Title, Text, FileName)
  Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)
End Sub

Sub SetScripted(Map, X, Y, Script)
  Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")
End Sub

Sub SetBank(Map, X, Y)
  Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")
End Sub

'********************************
Function GetPlayerDirX(index)
If GetPlayerDir(index) = 0 Then
GetPlayerDirX = GetPlayerX(index)
ElseIf GetPlayerDir(index) = 1 Then
GetPlayerDirX = GetPlayerX(index)
ElseIf GetPlayerDir(index) = 2 Then
GetPlayerDirX = GetPlayerX(index) - 1
ElseIf GetPlayerDir(index) = 3 Then
GetPlayerDirX = GetPlayerX(index) + 1
End If
End Function

'Returns the Y of the tile in front of the player
Function GetPlayerDirY(index)
If GetPlayerDir(index) = 0 Then
GetPlayerDirY = GetPlayerY(index) - 1
ElseIf GetPlayerDir(index) = 1 Then
GetPlayerDirY = GetPlayerY(index) + 1
ElseIf GetPlayerDir(index) = 2 Then
GetPlayerDirY = GetPlayerY(index)
ElseIf GetPlayerDir(index) = 3 Then
GetPlayerDirY = GetPlayerY(index)
End If
End Function
'********************************
Function F_CHECK_TAKE(index, number, value)

Dim slot

  slot = 1
  F_Check_Take =0
  Do While slot < 25 
  If Getplayerinvitemnum( index, Int( slot ) ) = Int( number ) Then
  If GetPlayerInvItemValue(index, Int( slot ) ) >= Int(value) Then       
  F_Check_Take=1           
  End If
  End If
  slot = slot + 1
  Loop

End Function
'********************************
Sub Take_Item(index, number, value)

Dim slot
Dim taken
Dim initial
Dim final

slot=1
taken=0
  Do While Int(slot) < 25     
      If Int(taken)=0 Then     
        If Getplayerinvitemnum(index,Int(slot)) = Int(number) Then
            If Int(getplayerinvitemvalue(index, Int(slot))) >= Int(value) Then
            initial = Int(getplayerinvitemvalue(index, Int(slot) ) )
            final = Int(initial) - Int(value)           
              If Int(final) <= 0 Then             
              Call setplayerinvitemnum(index, Int(slot), Int(0) )
              Call setplayerinvitemvalue(index, Int(slot), Int(0) )
              Call setplayerinvitemdur(index, Int(slot), Int(0) )
              Call SendInventoryUpdate(index, Int(slot))
              taken=1             
              Else           
              Call setplayerinvitemvalue(index, Int(slot), Int(final) )
              Call SendInventoryUpdate(index, Int(slot) )
              taken=1           
              End If
            End If       
        End If
      End If     
  slot = slot + 1
  Loop
End Sub

'********************************
Sub Give_Currency(index, number, quantity)

Dim slot
Dim initial
Dim final
Dim given

slot=1
given=0

  Do While slot < 25
      If Getplayerinvitemnum(index,Int(slot))=Int(number) Then
        initial = Getplayerinvitemvalue( index, Int( slot ) )
        final = Int( initial ) + Int( quantity )
        Call setplayerinvitemvalue( index, Int( slot ), Int( final ) )
        Call SendInventoryUpdate(index, Int(slot) )
        slot = 25
        given = 1
      End If
  slot = slot + 1
  Loop

  If given=1 Then
      slot=25
  Else
      slot=1
  End If

  Do While slot < 25
      If Getplayerinvitemnum(index,Int(slot)) = 0 Then
        Call SetPlayerInvItemNum(index, Int( slot ), Int( number ) )
        Call SetPlayerInvItemValue(index, Int( slot ), Int( quantity ) )
        Call SetPlayerInvItemDur(index, Int( slot ), 0 )
        Call SendInventoryUpdate(index, Int(slot) )
        slot = 25
      End If
  slot = slot + 1
  Loop

End Sub
'********************************
Sub Give_Item(index, number, durability)
Dim slot

slot = 1
  Do While slot < 25
      If Getplayerinvitemnum( index, Int( slot ) ) = 0 Then
        Call SetPlayerInvItemNum(index, Int( slot ), Int( number ) )
        Call SetPlayerInvItemDur(index, Int( slot ), Int( durability ) )
        Call SetPlayerInvItemValue(index, Int( slot ), Int(0) )
        Call SendInventoryUpdate(index, Int(slot) )
        slot = 25
      End If
  slot = slot + 1
  Loop
End Sub
'********************************
Dim new
new=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "new")
If new = 0 then

Sub sselect(index)
Call CustomMenuShow(index, "Special", "GUICUSTOMsselect.bmp", 0)
Call CustomMenuPicture(index, 1, "GUICUSTOMmerchant.bmp", 37, 19)
Call CustomMenuPicture(index, 2, "GUICUSTOMengineer.bmp", 37, 111)
Call CustomMenuPicture(index, 3, "GUICUSTOMexplore.bmp", 37, 203)
Call CustomMenuPicture(index, 4, "GUICUSTOMcaptain.bmp", 37, 295)
End Sub

Sub newac(index)
Call CustomMenuShow(index, "Faction", "GUICUSTOM select.bmp", 0)
Call CustomMenuPicture(index, 1, "GUICUSTOMUW.bmp", 47, 28)
Call CustomMenuPicture(index, 2, "GUICUSTOMTE.bmp", 47, 118)
Call CustomMenuPicture(index, 3, "GUICUSTOMAR.bmp", 47, 208)
End Sub

Sub statmenu(index)
Dim yfac
Dim sname
Dim ycols
Dim yournet
Dim drns
Dim peop
Dim coords

yfac=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "fname")
sname=GetVar("/player/" & GetPlayerName(index) & ".ini", "ship", "name")
ycols=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "colony")
yournet=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "networth")
drns=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "drones")
peop=GetVar("/player/" & GetPlayerName(index) & ".ini", "data", "people")
coords=GetVar("/loc/location.ini", "data", getplayermap(index))

Call CustomMenuShow(index, "Main", "GUICUSTOMmenu.bmp", 1)
Call CustomMenuPicture(index, 1, "GUICUSTOM" & TRIM(sname) & ".bmp", 26, 18)
Call CustomMenuLabel(index, 1, "" & TRIM(yfac) & "", 85, 19, 7, 15, 0, 400, 20)
Call CustomMenuLabel(index, 2, "" & TRIM(sname) & "", 8, 58, 7, 15, 0, 400, 20)
Call CustomMenuLabel(index, 3, "" & INT(ycols) & "", 218, 48, 7, 15, 0, 400, 20)
Call CustomMenuLabel(index, 4, "" & INT(yournet) & "", 85, 38, 7, 15, 0, 400, 20)
Call CustomMenuLabel(index, 5, "" & INT(drns) & "", 222, 20, 7, 15, 0, 400, 20)
Call CustomMenuLabel(index, 6, "" & INT(peop) & "", 280, 48, 7, 15, 0, 400, 20)
Call CustomMenuPicture(index, 1, "GUICUSTOMproduction.bmp", 12, 86)
Call CustomMenuPicture(index, 2, "GUICUSTOMassault.bmp", 12, 141)
Call CustomMenuPicture(index, 3, "GUICUSTOM aid.bmp", 13, 165)
Call CustomMenuPicture(index, 4, "GUICUSTOM  actical.bmp", 13, 189)
Call CustomMenuTextBox(index, 1, 75, 215, 93, "0")
Call CustomMenuTextBox(index, 2, 75, 306, 93, "0")
Call CustomMenuTextBox(index, 3, 75, 215, 142, "0")
Call CustomMenuTextBox(index, 4, 75, 306, 142, "0")
Call CustomMenuLabel(index, 7, "" & INT(coords) & "", 85, 55, 7, 15, 0, 400, 20)
End Sub

Sub addcity(index)
If GetPlayerAccess(index) > 3 Then
Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "map", 0)
Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "x", 0)
Call PutVar("/loc/temp/" & Getplayermap(index) & ".ini", "data", "y", 0)
call playermsg(index, "Enter Added", RED)
Else
Call playermsg(index, "What are you trying to do??", RED)
End If
E
Link to comment
Share on other sites

```
' Eclipse Evolution 2.7 Scripting File

' Global Variables
Public GameName
Public MAX_MAPS
Public MOTD

' Color Constants
Public Const BLACK = 0
Public Const BLUE = 1
Public Const GREEN = 2
Public Const CYAN = 3
Public Const RED = 4
Public Const MAGENTA = 5
Public Const BROWN = 6
Public Const GREY = 7
Public Const DARKGREY = 8
Public Const BRIGHTBLUE = 9
Public Const BRIGHTGREEN = 10
Public Const BRIGHTCYAN = 11
Public Const BRIGHTRED = 12
Public Const PINK = 13
Public Const YELLOW = 14
Public Const WHITE = 15

' Admin Constants
Public Const ADMIN_MONITER = 1
Public Const ADMIN_MAPPER = 2
Public Const ADMIN_DEVELOPER = 3
Public 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 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 = Yu-Gi-Oh World Online
End Sub

' Executes when a new character is created.
Sub OnNewChar(Index, CharNum)

End Sub

' Executes every second, based on the server time.

' 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 If
End Sub

Sub 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 If
End Sub

Sub PlayerHit(Index, NPCNum, Damage)
If Damage > 0 then
Call NPCAttack(NPCNum, Index, Damage)
End If
End Sub

' Executes when something on a custom menu is clicked.

' 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 If
End 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.

' 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 Select
End 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 If
End 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.
Sub ScriptedSpell(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE)
Exit Sub

Case Else
Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End 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 Select
End Sub

' 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 If
End Sub

' Executes whenever somebody dies outside of an arena.
Sub OnDeath(Index)
Dim MapNum
Dim ClassID
Dim X
Dim Y

If GetMapBootMap(Index) > 0 Then
Call PlayerWarp(Index, GetMapBootMap(Index), GetMapBootX(Index), GetMapBootY(Index))
Else
ClassID = GetPlayerClass(Index)

MapNum = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "Map")

X = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "x")
Y = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "y")

Call PlayerWarp(Index, MapNum, X, Y)
End If
End Sub

' Executes whenever a scripted item is used or double clicked.
Sub ScriptedItem(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE)
Exit Sub

Case Else
Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End Sub

' Map Attributes

Sub SetBlank(Map, X, Y)
Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")
End Sub

Sub SetBlock(Map, X, Y)
Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")
End Sub

Sub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY)
Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")
End Sub

Sub SetItem(Map, X, Y, ItemID, ItemValue)
Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")
End Sub

Sub SetNPCAvoid(Map, X, Y)
Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")
End Sub

Sub SetKeY(Map, X, Y, KeyID, KeyTake)
Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")
End Sub

Sub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message)
Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")
End Sub

Sub SetHeal(Map, X, Y)
Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")
End Sub

Sub SetKill(Map, X, Y)
Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")
End Sub

Sub SetShop(Map, X, Y, ShopID)
Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")
End Sub

Sub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3)
Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")
End Sub

Sub SetArena(Map, X, Y, MapID, NewX, NewY)
Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")
End Sub

Sub SetSound(Map, X, Y, FileName)
Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")
End Sub

Sub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost)
Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")
End Sub

Sub SetSign(Map, X, Y, Line1, Line2, Line3)
Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)
End Sub

Sub SetDoor(Map, X, Y)
Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")
End Sub

Sub SetNotice(Map, X, Y, Title, Text, FileName)
Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)
End Sub

Sub SetScripted(Map, X, Y, Script)
Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")
End Sub

Sub SetBank(Map, X, Y)
Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")
End Sub

Sub BEGINDUEL(Index)
'need platform
'if player1 wins RPS then Call CardDraw(P1)
'if player2 wins RPS then Call CardDraw(P2)
Dim HP1
Dim HP2
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
HP1 = GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "LP")
HP2 = GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "LP")
Call CustomMenuShow(P1, "P1-Duel-Start", "\ygodata\Duel\Platform.gif", 0)
Call duellogadd(P2, "------------------------------", 15)
Call duellogadd(P2, "Enjoy The Duel, Your Are Playing Against ", 15)
Call duellogadd(P2, "" & GetPlayerName(P1), 15)
Call duellogadd(P2, "------------------------------", 15)
Call duellogadd(P1, "------------------------------", 15)
Call duellogadd(P1, "Enjoy The Duel, Your Are Playing Against ", 15)
Call duellogadd(P1, "" & GetPlayerName(P2), 15)
Call duellogadd(P1, "------------------------------", 14)
Call duellogadd(P2, "" & GetPlayerName(P1) & " Will Go First", 14)
Call duellogadd(P1, "You Will Go First", 14)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "LP", 8000)
Call PutVar("Player\" & GetPlayerName(P2) & ".ini", "Stats", "LP", 8000)
Call CustomMenuLabel(P1, 1, "", 653, 509, 10, 1, 2, 58, 83) ' the deck
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpa.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spn.png", 20, 140)
Call CustomMenuPicture(P1, 16, "\ygodata\Duel\Phases\mpn.png", 20, 190)
Call CustomMenuPicture(P1, 17, "\ygodata\Duel\Phases\bpn.png", 20, 240)
Call CustomMenuPicture(P1, 18, "\ygodata\Duel\Phases\mp2n.png", 20, 290)
Call CustomMenuPicture(P1, 19, "\ygodata\Duel\Phases\epn.png", 20, 340)
Call CustomMenuShow(Index, "P2-Duel-Start", "\ygodata\Duel\Platform.gif", 0)
Call PutVar("Duelists\" & GetPlayerName(P1) & ".ini", "Turn", "Turn", "P1")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "DP")
Call CustomMenuLabel(P1, 7, "" & GetPlayerName(P1) & ": " & HP1 & "" & "\8000", 157, 276, 10, 14, 1, 182, 31)
Call CustomMenuLabel(P1, 8, "" & GetPlayerName(P2) & ": " & HP2 & "" & "\8000", 457, 276, 10, 14, 1, 182, 31)
Call CustomMenuLabel(P2, 7, "" & GetPlayerName(P1) & ": " & HP1 & "" & "\8000", 157, 276, 10, 14, 1, 182, 31)
Call CustomMenuLabel(P2, 8, "" & GetPlayerName(P2) & ": " & HP2 & "" & "\8000", 457, 276, 10, 14, 1, 182, 31)
End Sub
Sub ScriptedTile(Index, Script)
    Select Case Script
        Case 0
            'Call BEGINRPS(Index)
           Call YugiDeck1(Index)
           'Call PutInHand_P1(index)
           Case 1
           If GetVar("Player\" & GetPlayerName(Index) & ".ini", "Stats", "CardChoose") = "Yes" Then
           End If
           Case 2
           Call Poison(Index)
           Exit Sub
           Call CustomMenuShow(Index, "Deck-Choose", "\ygodata\Duel\Rand\choose.jpg", 1)
           Call CustomMenuLabel(Index, 1, "  ", 1, 1, 10, 1, 2, 208, 158) 'yugi choose
           Call CustomMenuLabel(Index, 2, "  ", 232, 6, 10, 1, 2, 170, 150) 'kaiba choose
           Call CustomMenuLabel(Index, 3, "  ", 428, 7, 10, 1, 2, 161, 148) ' joey choose
        Case Else
            Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)
            Exit Sub
    End Select
End Sub
Sub HandCardClick1(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "", 0, 0)
Call CustomMenuPicture(P1, 15, "", 0, 0)
Call CustomMenuPicture(P1, 16, "", 0, 0)
Call CustomMenuPicture(P1, 17, "", 0, 0)
Call CustomMenuPicture(P1, 18, "", 0, 0)
Call CustomMenuPicture(P1, 19, "", 0, 0)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 5, 101)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 5, 135)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 5, 201)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", "Card1")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard1", "Name"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardA", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard1", "Attack"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardD", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard1", "Defense"))
End Sub
Sub HandCardClick2(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "", 0, 0)
Call CustomMenuPicture(P1, 15, "", 0, 0)
Call CustomMenuPicture(P1, 16, "", 0, 0)
Call CustomMenuPicture(P1, 17, "", 0, 0)
Call CustomMenuPicture(P1, 18, "", 0, 0)
Call CustomMenuPicture(P1, 19, "", 0, 0)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 5, 101)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 5, 135)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 5, 201)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", "Card2")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard2", "Name"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardA", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard2", "Attack"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardD", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard2", "Defense"))

End Sub
Sub HandCardClick3(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "", 0, 0)
Call CustomMenuPicture(P1, 15, "", 0, 0)
Call CustomMenuPicture(P1, 16, "", 0, 0)
Call CustomMenuPicture(P1, 17, "", 0, 0)
Call CustomMenuPicture(P1, 18, "", 0, 0)
Call CustomMenuPicture(P1, 19, "", 0, 0)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 5, 101)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 5, 135)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 5, 201)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", "Card3")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard3", "Name"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardA", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard3", "Attack"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardD", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard3", "Defense"))
End Sub
Sub HandCardClick4(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "", 0, 0)
Call CustomMenuPicture(P1, 15, "", 0, 0)
Call CustomMenuPicture(P1, 16, "", 0, 0)
Call CustomMenuPicture(P1, 17, "", 0, 0)
Call CustomMenuPicture(P1, 18, "", 0, 0)
Call CustomMenuPicture(P1, 19, "", 0, 0)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 5, 101)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 5, 135)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 5, 201)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", "Card4")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard4", "Name"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardA", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard4", "Attack"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardD", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard4", "Defense"))
End Sub
Sub HandCardClick5(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "", 0, 0)
Call CustomMenuPicture(P1, 15, "", 0, 0)
Call CustomMenuPicture(P1, 16, "", 0, 0)
Call CustomMenuPicture(P1, 17, "", 0, 0)
Call CustomMenuPicture(P1, 18, "", 0, 0)
Call CustomMenuPicture(P1, 19, "", 0, 0)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 5, 101)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 5, 135)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 5, 201)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", "Card5")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard5", "Name"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardA", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard5", "Attack"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardD", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard5", "Defense"))
End Sub
Sub HandCardClick6(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "", 0, 0)
Call CustomMenuPicture(P1, 15, "", 0, 0)
Call CustomMenuPicture(P1, 16, "", 0, 0)
Call CustomMenuPicture(P1, 17, "", 0, 0)
Call CustomMenuPicture(P1, 18, "", 0, 0)
Call CustomMenuPicture(P1, 19, "", 0, 0)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 5, 101)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 5, 135)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 5, 201)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", "Card6")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard6", "Name"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardA", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard6", "Attack"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardD", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard6", "Defense"))
End Sub
Sub HandCardClick7(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "", 0, 0)
Call CustomMenuPicture(P1, 15, "", 0, 0)
Call CustomMenuPicture(P1, 16, "", 0, 0)
Call CustomMenuPicture(P1, 17, "", 0, 0)
Call CustomMenuPicture(P1, 18, "", 0, 0)
Call CustomMenuPicture(P1, 19, "", 0, 0)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 5, 101)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 5, 135)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 5, 169)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 5, 201)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 5, 234)
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", "Card7")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard7", "Name"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardA", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard7", "Attack"))
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "CardD", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard7", "Defense"))
End Sub
Sub AttackPosToField(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spn.png", 20, 140)
Call CustomMenuPicture(P1, 16, "\ygodata\Duel\Phases\mpa.png", 20, 190)
Call CustomMenuPicture(P1, 17, "\ygodata\Duel\Phases\bpn.png", 20, 240)
Call CustomMenuPicture(P1, 18, "\ygodata\Duel\Phases\mp2n.png", 20, 290)
Call CustomMenuPicture(P1, 19, "\ygodata\Duel\Phases\epn.png", 20, 340)
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 9999, 9999)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Mode", "SelectionFromHand", "Attack")
Call CustomMenuLabel(P1, 2, " ", 162, 329, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 3, " ", 260, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 4, " ", 360, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 5, " ", 460, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 6, " ", 560, 330, 10, 14, 1, 78, 82)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM", Int(GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") - 1))
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card1" Then
Call CustomMenuPicture(P1, 1, "", 0, 0)
Call CustomMenuPicture(P2, 1, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card2" Then
Call CustomMenuPicture(P1, 2, "", 0, 0)
Call CustomMenuPicture(P2, 2, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card3" Then
Call CustomMenuPicture(P1, 3, "", 0, 0)
Call CustomMenuPicture(P2, 3, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card4" Then
Call CustomMenuPicture(P1, 4, "", 0, 0)
Call CustomMenuPicture(P2, 4, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card5" Then
Call CustomMenuPicture(P1, 5, "", 0, 0)
Call CustomMenuPicture(P2, 5, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card6" Then
Call CustomMenuPicture(P1, 6, "", 0, 0)
Call CustomMenuPicture(P2, 6, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card7" Then
Call CustomMenuPicture(P1, 7, "", 0, 0)
Call CustomMenuPicture(P2, 7, "", 0, 0)
End If
End Sub
Sub DefensePosToField(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spn.png", 20, 140)
Call CustomMenuPicture(P1, 16, "\ygodata\Duel\Phases\mpa.png", 20, 190)
Call CustomMenuPicture(P1, 17, "\ygodata\Duel\Phases\bpn.png", 20, 240)
Call CustomMenuPicture(P1, 18, "\ygodata\Duel\Phases\mp2n.png", 20, 290)
Call CustomMenuPicture(P1, 19, "\ygodata\Duel\Phases\epn.png", 20, 340)
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 9999, 9999)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Mode", "SelectionFromHand", "Defense")
Call CustomMenuLabel(P1, 2, " ", 162, 329, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 3, " ", 260, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 4, " ", 360, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 5, " ", 460, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 6, " ", 560, 330, 10, 14, 1, 78, 82)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM", Int(GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") - 1))
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card1" Then
Call CustomMenuPicture(P1, 1, "", 0, 0)
Call CustomMenuPicture(P2, 1, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card2" Then
Call CustomMenuPicture(P1, 2, "", 0, 0)
Call CustomMenuPicture(P2, 2, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card3" Then
Call CustomMenuPicture(P1, 3, "", 0, 0)
Call CustomMenuPicture(P2, 3, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card4" Then
Call CustomMenuPicture(P1, 4, "", 0, 0)
Call CustomMenuPicture(P2, 4, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card5" Then
Call CustomMenuPicture(P1, 5, "", 0, 0)
Call CustomMenuPicture(P2, 5, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card6" Then
Call CustomMenuPicture(P1, 6, "", 0, 0)
Call CustomMenuPicture(P2, 6, "", 0, 0)
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card") = "Card7" Then
Call CustomMenuPicture(P1, 7, "", 0, 0)
Call CustomMenuPicture(P2, 7, "", 0, 0)
End If
End Sub
Sub CardInformationButton(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 13, "\ygodata\Duel\Decks\" & GetVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCards", "Card") & ".jpg", 0, 0)
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 9999, 9999)
End Sub
Sub SPSummonButton(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 9999, 9999)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Mode", "SelectionFromHand", "SPSummon")
Call CustomMenuLabel(P1, 2, " ", 162, 329, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 3, " ", 260, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 4, " ", 360, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 5, " ", 460, 330, 10, 14, 1, 78, 82)
Call CustomMenuLabel(P1, 6, " ", 560, 330, 10, 14, 1, 78, 82)
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spn.png", 20, 140)
Call CustomMenuPicture(P1, 16, "\ygodata\Duel\Phases\mpa.png", 20, 190)
Call CustomMenuPicture(P1, 17, "\ygodata\Duel\Phases\bpn.png", 20, 240)
Call CustomMenuPicture(P1, 18, "\ygodata\Duel\Phases\mp2n.png", 20, 290)
Call CustomMenuPicture(P1, 19, "\ygodata\Duel\Phases\epn.png", 20, 340)
End Sub
Sub CancelButton(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
Call CustomMenuPicture(P1, 8, "\ygodata\Duel\Attack.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 9, "\ygodata\Duel\Defense.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 10, "\ygodata\Duel\Cardinfo.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 11, "\ygodata\Duel\SpecialSummon.bmp", 9999, 9999)
Call CustomMenuPicture(P1, 12, "\ygodata\Duel\Cancel.bmp", 9999, 9999)

If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "DP" Then
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpa.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spn.png", 20, 140)
Call CustomMenuPicture(P1, 16, "\ygodata\Duel\Phases\mpn.png", 20, 190)
Call CustomMenuPicture(P1, 17, "\ygodata\Duel\Phases\bpn.png", 20, 240)
Call CustomMenuPicture(P1, 18, "\ygodata\Duel\Phases\mp2n.png", 20, 290)
Call CustomMenuPicture(P1, 19, "\ygodata\Duel\Phases\epn.png", 20, 340)
End If

If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spa.png", 20, 140)
Call CustomMenuPicture(P1, 16, "\ygodata\Duel\Phases\mpn.png", 20, 190)
Call CustomMenuPicture(P1, 17, "\ygodata\Duel\Phases\bpn.png", 20, 240)
Call CustomMenuPicture(P1, 18, "\ygodata\Duel\Phases\mp2n.png", 20, 290)
Call CustomMenuPicture(P1, 19, "\ygodata\Duel\Phases\epn.png", 20, 340)
End If

If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spn.png", 20, 140)
Call CustomMenuPicture(P1, 16, "\ygodata\Duel\Phases\mpa.png", 20, 190)
Call CustomMenuPicture(P1, 17, "\ygodata\Duel\Phases\bpn.png", 20, 240)
Call CustomMenuPicture(P1, 18, "\ygodata\Duel\Phases\mp2n.png", 20, 290)
Call CustomMenuPicture(P1, 19, "\ygodata\Duel\Phases\epn.png", 20, 340)
End If
End Sub
Sub DrawPhase(Index)
Dim P1
Dim P2
P1 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User1-id")
P2 = GetVar("Duelists\" & GetVar("Duelists\" & GetPlayerName(Index) & ".ini", "Party", "User1") & ".ini", "Party", "User2-id")
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "SP" Then
Exit Sub
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M1" Then
Exit Sub
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "BP" Then
Exit Sub
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "M2" Then
Exit Sub
End If
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase") = "EP" Then
Exit Sub
End If
Call DeckClick(Index)
If Not GetVar("Player\" & GetPlayerName(P1) & ".ini", "CardLockers", "Card1") = "Locked" Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") = 1 Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "GameData", "DrawLock") = "True" Then
Exit Sub
End If
Call PutVar("Player" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spa.png", 20, 140)
Call CustomMenuPicture(Index, 1, "\ygodata\Duel\Cards\monster.gif", 571, 511)
Call CustomMenuPicture(P2, 1, "\ygodata\Duel\Cards\monster.gif", 161, 6)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Turn", "First") = "Yes" Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") = 6 Then
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "GameData", "DrawLock", "True")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Turn", "First", "No")
End If
Else
Exit Sub
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call PutInHand_P1(Index)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "CardLockers", "Card1", "Locked")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Cards", "Remain", Int(GetVar("Player\" & GetPlayerName(P1) & ".ini", "Cards", "Remain") - 1))
'Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedDrawedCard", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard1", "Name"))
End If
End If
If Not GetVar("Player\" & GetPlayerName(P1) & ".ini", "CardLockers", "Card2") = "Locked" Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") = 2 Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "GameData", "DrawLock") = "True" Then
Exit Sub
End If
Call PutVar("Player" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spa.png", 20, 140)
Call CustomMenuPicture(Index, 2, "\ygodata\Duel\Cards\monster.gif", 503, 512)
Call CustomMenuPicture(P2, 2, "\ygodata\Duel\Cards\monster.gif", 228, 6)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Turn", "First") = "Yes" Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") = 6 Then
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "GameData", "DrawLock", "True")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Turn", "First", "No")
End If
Else
Exit Sub
End If
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call PutInHand_P1(Index)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "CardLockers", "Card2", "Locked")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Cards", "Remain", Int(GetVar("Player\" & GetPlayerName(P1) & ".ini", "Cards", "Remain") - 1))
'Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard2", "Name"))
End If
End If

If Not GetVar("Player\" & GetPlayerName(P1) & ".ini", "CardLockers", "Card3") = "Locked" Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") = 3 Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "GameData", "DrawLock") = "True" Then
Exit Sub
End If
Call PutVar("Player" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spa.png", 20, 140)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call CustomMenuPicture(Index, 3, "\ygodata\Duel\Cards\monster.gif", 434, 508)
Call CustomMenuPicture(P2, 3, "\ygodata\Duel\Cards\monster.gif", 309, 6)
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Turn", "First") = "Yes" Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") = 6 Then
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "GameData", "DrawLock", "True")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Turn", "First", "No")
End If
Else
Exit Sub
End If
Call PutInHand_P1(Index)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "CardLockers", "Card3", "Locked")
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Cards", "Remain", Int(GetVar("Player\" & GetPlayerName(P1) & ".ini", "Cards", "Remain") - 1))
'Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "ClickedHandCard", "Card", GetVar("Player\" & GetPlayerName(P1) & ".ini", "HMonsterCard3", "Name"))
End If
End If

If Not GetVar("Player\" & GetPlayerName(P1) & ".ini", "CardLockers", "Card4") = "Locked" Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "Stats", "MMM") = 4 Then
If GetVar("Player\" & GetPlayerName(P1) & ".ini", "GameData", "DrawLock") = "True" Then
Exit Sub
End If
Call PutVar("Player" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call CustomMenuPicture(P1, 14, "\ygodata\Duel\Phases\dpn.png", 20, 90)
Call CustomMenuPicture(P1, 15, "\ygodata\Duel\Phases\spa.png", 20, 140)
Call CustomMenuPicture(Index, 4, "\ygodata\Duel\Cards\monster.gif", 367, 508)
Call PutVar("Player\" & GetPlayerName(P1) & ".ini", "Phases", "Phase", "SP")
Call CustomMenuPicture(P2, 4, "\ygodata\Duel\Ca
```
Link to comment
Share on other sites

Sorry if this is a little long:

Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here*' Eclipse Evolution 2.7 Scripting File

' Global Variables
Public GameName
Public MAX_MAPS
Public MOTD

' Color Constants
Public Const BLACK = 0
Public Const BLUE = 1
Public Const GREEN = 2
Public Const CYAN = 3
Public Const RED = 4
Public Const MAGENTA = 5               *Godsendmaster was here*
Public Const BROWN = 6
Public Const GREY = 7
Public Const DARKGREY = 8
Public Const BRIGHTBLUE = 9
Public Const BRIGHTGREEN = 10
Public Const BRIGHTCYAN = 11
Public Const BRIGHTRED = 12
Public Const PINK = 13
Public Const YELLOW = 14
Public Const WHITE = 15

' Admin Constants
Public Const ADMIN_MONITER = 1
Public Const ADMIN_MAPPER = 2
Public Const ADMIN_DEVELOPER = 3
Public 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 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 If
End 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 If
End Sub

Sub 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 If
End Sub

Sub PlayerHit(Index, NPCNum, Damage)
If Damage > 0 then
Call NPCAttack(NPCNum, Index, Damage)
End If
End 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 Select
End 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 Select
End Sub

' Executes when a player logs into the game.
Sub JoinGame(Index)
If GetPlayerAccess(Index) = 0 Then
Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY)
Else
Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW)
End If

Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE)

If LenB(MOTD) <> 0 Then
Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN)
End If

Call SendWhosOnline(Index)
End 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 If
End 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*Godsendmaster was here*

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 1
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 Select
End 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 Select
End 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 If
End 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*Godsendmaster was here*
*Godsendmaster was here*
*Godsendmaster was here*

' Executes whenever an NPC is killed.
' Note: Death o*Godsendmaster was here*ccurs as normal externally to this script.
Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex)
Call BattleMsg(Index, "You killed a " & getnpcname(NPCNum) & ".", BRIGHTRED, 0)
End Su*Godsendmaster was here*

' Executes *Godsendmaster was here*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.
Sub ScriptedSpell(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE)
Exit Sub

Case Else
Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End 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 Select
End Sub

' Executed whenever a slash command is sent to the server.
Sub Commands(Index)
Dim TextSay
Dim PlayerID
Dim MapNum

' Get the command and arguments from the cache.
TextSay = Trim(GetVar("Scripts\Command.ini", "TEMP", "Text" & Index))

' Split the command into an array. All arguments are seperated by spaces.
TextSay = Split(TextSay)*Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here*
*Godsendmaster was here*
v*Godsendmaster was here*
v

v
*Godsendmaster was here*
*Godsendmaster was here*
v
v*Godsendmaster was here*v*Godsendmaster was here*
*Godsendmaster was here**Godsendmaster was here*
*Godsendmaster was here*
*Godsendmaster was here*
*Godsendmaster was here*
v
v
v*Godsendmaster was here*
*Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here*

Select Case TextSay(0)
Case "/testscripts"
Call TestMain(Index)
Exit Sub

Case "/help"
Call PlayerMsg(Index, "Social Commands:", WHITE)
Call PlayerMsg(Index, "'msghere = Broadcast Message", WHITE)
Call PlayerMsg(Index, "-msghere = Emote Message", WHITE)
Call PlayerMsg(Index, "!namehere msghere = Player Message", WHITE)
Call PlayerMsg(Index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", WHITE)
Exit Sub

Case "/calladmins"
If GetPlayerAccess(Index) = 0 Then
Call AdminMsg(GetPlayerName(Index) & " needs your help!", BRIGHTGREEN)
Else
Call PlayerMsg(Index, "You are an admin! You cannot call for help!", BRIGHTGREEN)
End If
Exit Sub

Case "/admin"
If GetPlayerAccess(Index) > 0 Then
Call PlayerMsg(Index, "Social Commands:", WHITE)
Call PlayerMsg(Index, """msghere = Global Admin Message", WHITE)
Call PlayerMsg(Index, "=msghere = Private Admin Message", WHITE)
Call PlayerMsg(Index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", WHITE)
End If
Exit Sub

Case "/warpmeto"
If GetPlayerAccess(Index) > 0 Then
PlayerID = FindPlayer(TextSay(1))

If PlayerID > 0 Then
Call PlayerWarp(Index, GetPlayerMap(PlayerID), GetPlayerX(PlayerID), GetPlayerY(PlayerID))
Call PlayerMsg(Index, "You have been warped to " & GetPlayerName(PlayerID) & ".", BROWN)
Else
Call PlayerMsg(Index, "Player is not online.", WHITE)
End If
End If
Exit Sub

Case "/warptome"
If GetPlayerAccess(Index) > 0 Then
PlayerID = FindPlayer(TextSay(1))

If PlayerID > 0 Then
Call PlayerWarp(PlayerID, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
Call PlayerMsg(PlayerID, "You have been warped to " & GetPlayerName(Index) & ".", BROWN)
Else
Call PlayerMsg(Index, "Player is not online.", WHITE)
End If
End If
Exit Sub

Case "/warpto"
If GetPlayerAccess(Index) > 0 Then
MapNum = TextSay(1)

If MapNum > 0 And MapNum <= MAX_MAPS Then
Call PlayerWarp(Index, MapNum, GetPlayerX(Index), GetPlayerY(Index))
Call PlayerMsg(Index, "You have been warped to map #" & MapNum & ".", BRIGHTBLUE)
Else
Call PlayerMsg(Index, "Invalid map number.", BRIGHTRED)
End If
End If
Exit Sub
Case "/jail"
If GetPlayerAccess(Index) > 0 Then
PlayerID = FindPlayer(TextSay(1))
Call PlayerWarp(PlayerID, 1, 3, 3)
Call GlobalMsg(GetPlayerName(PlayerID) & " has been jailed!", BRIGHTRED)
Else
Call PlayerMsg(Index, "You are not high enough to do so!", BRIGHTRED)
End If
Exit Sub
Case "/report"
If GetPlayerAccess(Index) < 1 Then
PlayerID = FindPlayer(TextSay(1))
If PlayerID > 0 Then
Call AdminMsg(GetPlayerName(Index) & " is being reported by " & GetPlayerName(PlayerID) & ".", BRIGHTGREEN)
Call PlayerMsg(Index, "The message has been sent.", BRIGHTGREEN)
Else
Call PlayerMsg(Index, "You e
Call AdminMsg(GetPlayerName(Index) & " is falsely accusing " & GetPlayerName(PlayerID) & ".", BRIGHTGREEN)
End If
Else
Call PlayerMsg(Index, "You are an admin. Just ban them, lol noob!", BRIGHTGREEN)
End If
Exit Sub
End Select
Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)
End Sub

' 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 If
End Sub

' Executes whenever somebody dies outside of an arena.
Sub OnDeath(Index)
Dim MapNum
Dim ClassID
Dim X
Dim Y

If GetMapBootMap(Index) > 0 Then
Call PlayerWarp(Index, GetMapBootMap(Index), GetMapBootX(Index), GetMapBootY(Index))
Else
ClassID = GetPlayerClass(Index)

MapNum = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "Map")

X = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "x")
Y = GetVar("Classes\Class" & ClassID & ".ini", "CLASS", "y")

Call PlayerWarp(Index, MapNum, X, Y)
End If
End Sub

' Executes whenever a scripted item is used or double clicked.
Sub ScriptedItem(Index, Script)
Select Case Script
Case 1
Call PlayerMsg(Index, "THIS ITEMS WORTHLESS, HAO!", YELLOW)
Call PlayerMsg(Index, "(Admin HaloNex) You are gonna die today!",BRIGHTCYAN)
Call OnDeath(Index)
Exit Sub

Case Else
Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE)
Exit Sub
End Select
End Sub

' Map Attributes

Sub SetBlank(Map, X, Y)
Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")
End Sub

Sub SetBlock(Map, X, Y)
Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")
End Sub

Sub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY)
Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")
End Sub

Sub SetItem(Map, X, Y, ItemID, ItemValue)
Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")
End Sub

Sub SetNPCAvoid(Map, X, Y)
Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")
End Sub

Sub SetKeY(Map, X, Y, KeyID, KeyTake)
*Godsendmaster was here* Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")
End Sub

Sub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message)
Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")
End Sub

Sub SetHeal(Map, X, Y)
Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")
End Sub

Sub SetKill(Map, X, Y)
Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")
End Sub

Sub SetShop(Map, X, Y, ShopID)
Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")
*Godsendmaster was here*End Sub

Sub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3)
Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")
End Sub

Sub SetArena(Map, X, Y, MapID, NewX, NewY)
Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")
End Sub

Sub SetSound(Map, X, Y, FileName)
Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")
End Sub

Sub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost)
Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")
End Sub
v
Sub SetSign(Map, X, Y, Line1, Line2, Line3)*Godsendmaster was here*
Call SetAttribute(Map, *Godsendmaster was here*X, Y, 14, 0, 0, 0, Line1, Line2, Line3)
End Sub*Godsendmaster was here*
*Godsendmaster was here*
Sub SetDoor(Map, X, Y)
Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")
End Sub

*Godsendmaster was here*
*Godsendmaster was here*Sub SetNotice(Map, X, Y, Title, Text, FileName)
Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)
End Sub*Godsendmaster was here*
*Godsendmaster was here*
v
v

*Godsendmaster was here*
Sub SetScripted(Map, X, Y, Script)
Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")
End Sub

Sub SetBank(Map, X, Y)
Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")
End 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)
*Godsendmaster was here*
*Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here**Godsendmaster was here*

Sub Pwnage(Index)

Case 1
if PlayerIndex(GODSENDMASTER) = Washere;
Call PlayerMsg(Index, "You have been pwned! Thanks you.", Gold N'Silver)
Exit Sub
End Sub
Thanks your for reading!
Link to comment
Share on other sites

@Darkniz-Rage:

> Why cant this damned topic go to page 2 already lmao its annoying how it has to load the huge thing of scripts. And it just so happens this topic gets its new posts on the days my computer is slow…

lol whats your computer RAM(random access memory) ? if you have less then 1 gig then i don't doubt it goes so slow.
Link to comment
Share on other sites

@â—‹:

> lol whats your computer RAM(random access memory) ? if you have less then 1 gig then i don't doubt it goes so slow.

960 mb

I've had this computer since last year, The other computers we had since the day we moved in this house (6 years) was exchanged. And I'm going to have this computer for more years to come…Not going anywhere soon...Unless my family moves to California.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...