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

Post your main.txt!


Guest
 Share

Recommended Posts

Well the title explains it all…

Well if you have a game then post your main.txt here... there's really no point in this at all.  And I PROMISE I'M NOT GOING TO STEAL YOUR SCRIPTS...  If I do then I'll give you all my forum cash.  And if I don't, then admins ban me.

You don't have to do this, this is just a pointless game... I'll start.

```
'ECLIPSE EVOLUTION DEFAULT MAIN
'Written By Baron
'August 16th

':: Text Color Code ::
'Black = 0
'Blue = 1
'Green = 2
'Cyan = 3
'Red = 4
'Magenta = 5
'Brown = 6
'Grey = 7
'DarkGrey = 8
'BrightBlue = 9
'BrightGreen = 10
'BrightCyan = 11
'BrightRed = 12           
'Pink = 13
'Yellow = 14
'White = 15

':: Mini Scripting Explanation :: 
'Writing with ' before it are comments and do not do anything.
'Subs are mini packages of code that run as a group from top to bottom
'You can run subs by calling them. ie call onattack(index) and index would be a player number.
'Dims are boxes for storing data in. You say dim MYSTUFF, then MYSTUFF = "thisword", and you could use MYSTUFF where ever you needed the text "thisword"
'Different commands have different pieces of info you must give to them. See the scripting forum for more help.

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub is used to run timed events based off the server time. 
Sub TimedEvent(Hours,Minutes,Seconds)     
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ' If minutes are zero then
If minutes = 0 Then
' If seconds are also zero then
If seconds = 0 Then
' Tell the admins to come check out the forums
Call adminmsg("Dear admins: Dont forget to vote for Eclipse. We need your support and fresh interest via the vote sites to keep the engine alive and updates continuing...", 14)
End If
End If

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs every time the player hits the ctrl key and attacks.
Sub OnAttack(index)                                               
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Call PlayerMsg(index, "You bravely attack the foe!", 15)

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when any player presses the PageUp key
Sub HotScript1(index)                                           
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Tell the player who hit the button to come check us out. 90% lack the dedication to build their own game so wont be a problem.
Call playermsg(index, "This game was built using Eclipse. You can check out this program at www.touchofproductions.com", 14)

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when any player presses the Delete key
Sub HotScript2(index)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim diceroll

'Rolling dice script

'diceroll becomes a Random number between 1 and 6
diceroll=Rand(6,1)
Call Mapmsg(GetPlayerMap(index), GetPlayerName(index) & " rolls a " & Int(diceroll) & " (1-6)", 15)
'Call CustomMenuShow(index, "custom", "\GUI\CUSTOM\test.bmp", 0)
'Call CustomMenuClose(index)

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when players press the End key
Sub HotScript3(index)                                             
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Telling players the game time
Call playermsg(index, "The time is " & getservertimehour() & ":" & getservertimeminute() & ":" & getservertimesecond() , 14)

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when players press the PageDown key
Sub HotScript4(index)                                           
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Example of finding an empty inventory slot and giving the player 1 of item 1 :
'If giveplayeritem(index, 1, 1, 0) = 1 Then
'Call playermsg(index,"You magically have one more gold piece.", 10)
'Else
'Call playermsg(index,"Your bag feels too heavy for more gold.", 12)
'End If

' Examples of using text bubbles :
'Call textbubble(index, 1, "These Are",GetPlayerMap(index), 4, 4, 10)
'Call textbubble(index, 2, "All Scripted",GetPlayerMap(index), 6, 6, 10)
'Call textbubble(index, 3, "Text Bubbles",GetPlayerMap(index), 8, 8, 10)
'Call textbubble(index, 4, "Only This",GetPlayerMap(index), 10, 10, 10)
'Call textbubble(index, 5, "Player Sees!",GetPlayerMap(index), 12, 12, 10)
'Call maptextbubble(20, "All players would see this one though.",GetPlayerMap(index), 4, 10, 14)
'Call textbubble(index, 6, "It does have limits in size, three lines is max.",GetPlayerMap(index), 2, 12, 12)

' Example of making a shop run :
'Call goshopping(index,1)

' Example of changing the players guild :
'Call setplayerguildname(index,"Bobzor!")
'Call setplayerguildaccess(index, 1)
'Call sendplayerdata(index)

' Example of changing the spawn type of a map to spawn an NPC, useful for bosses :
'Call ScriptSpawnNpc(15,GetPlayerMap(index),GetPlayerX(index), GetPlayerY(index),1)

' Example of spawning an item on a map just as though it had been dropped :
'Call Spawnitemonmap(GetPlayerMap(index),GetPlayerX(index), GetPlayerY(index),1,15,0)

' Example of locking a player so they cant move :
'Call lockplayer(index,1)

' Example of turning paperdoll on and off for a player and getting PD status
'Call PlayerMsg(index, GetPlayerPaperdoll(index), 15)
'Call ShowPlayerPaperdoll(index)
'Call HidePlayerPaperdoll(index)

' Example of changing skill level and EXP
'5 = skill num
'Call SetPlayerSkillLvl(index, 5, GetPlayerSkillLvl(index, 5) + 1)
'Call SetPlayerSkillExp(index, 5, GetPlayerSkillExp(index, 5) + 100)

' Example of calling a script
'Call Script("AnotherScript.txt", "ScriptExample", index)

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when something on a custom menu is clicked.
Sub MenuScripts(index, Clicked_Index, Menu_Type)         
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dim field_message
Dim menu_title
menu_title = getplayermenuclicktitle(index)
field_message = getplayermenuclickmsg(index)

  ' Figure out what type of button was clicked ie picture, textbox, label.
  Select Case Menu_Type

  Case 1
      ' PICTURE WAS CLICKED

    Case 2

    Case 3
      ' LABEL WAS CLICKED
If Clicked_index = 11 then
If Menu_Title = "Quest5" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Step1Complete", 1)
Call CustomMenuLabel(index, 11, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Menu_Title = "Quest1" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest1Step1Complete", 1)
Call CustomMenuLabel(index, 11, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
End If
ElseIf Clicked_index = 12 then
If Menu_Title = "Quest5" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Step2Complete", 1)
Call Take_Item(index, 14, 20)
Call CustomMenuLabel(index, 12, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Menu_Title = "Quest2" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest2Step1Complete", 1)
Call CustomMenuLabel(index, 12, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
End If
ElseIf Clicked_index = 13 then
If Menu_Title = "Quest5" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Step3Complete", 1)
Call Take_Item(index, 15, 10)
Call CustomMenuLabel(index, 13, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Menu_Title = "Quest2" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest2Step2Complete", 1)
Call CustomMenuLabel(index, 13, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
End If
ElseIf Clicked_index = 14 then
If Menu_title = "Quest5" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Step4Complete", 1)
Call Give_Item(index, 16, 1)
Call Take_Item(index, 51, 1)
Call CustomMenuLabel(index, 14, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Menu_Title = "Quest3" then
    Call CustomMenuClose(index)
    Call PutVar("Quests.ini", GetPlayerName(index), "Quest3Step1Complete", 1)
Call CustomMenuLabel(index, 14, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
End If
ElseIf Clicked_index = 15 then
If Menu_title = "Quest5" then
Call CustomMenuClose(index)
Call BattleMsg(index, "The Artisan made you the Falcon Armor!", 10, 0)
    Call Give_Item(index, 17, 0)
Call Take_Item(index, 16, 1)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Complete", 1)
Call CustomMenuLabel(index, 16, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 17, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 18, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Menu_Title = "Quest4" then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest4Step1Complete", 1)
Call CustomMenuLabel(index, 15, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
End If
ElseIf Clicked_index = 16 then
If Menu_title = "Quest5" then
Call CustomMenuClose(index)
Call BattleMsg(index, "The Artisan made you the Falcon Robes!", 10, 0)
    Call Give_Item(index, 18, 0)
Call Take_Item(index, 16, 1)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Complete", 1)
Call CustomMenuLabel(index, 16, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 17, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 18, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Menu_Title = "Quest4" then
Call CustomMenuClose(index)
Call BattleMsg(index, "The Artisan made you a Beast Fang Sword!", 10, 0)
    Call Give_Item(index, 11, 0)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest4Complete", 1)
Call CustomMenuLabel(index, 16, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 17, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 18, "", 390, 210, 10, 0, 2, 1, 1)
End If
ElseIf Clicked_index = 17 then
If Menu_title = "Quest5" then
Call CustomMenuClose(index)
Call BattleMsg(index, "The Artisan made you the Falcon Jumpsuit!", 10, 0)
    Call Give_Item(index, 19, 0)
Call Take_Item(index, 16, 1)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Complete", 1)
Call CustomMenuLabel(index, 16, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 17, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 18, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Menu_Title = "Quest4" then
Call CustomMenuClose(index)
Call BattleMsg(index, "The Artisan made you a Beast Fang Staff!", 10, 0)
    Call Give_Item(index, 12, 0)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest4Complete", 1)
Call CustomMenuLabel(index, 16, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 17, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 18, "", 390, 210, 10, 0, 2, 1, 1)
End If
ElseIf Clicked_index = 18 then
    Call CustomMenuClose(index)
    Call BattleMsg(index, "The Artisan made you some Beast Fang Knives!", 10, 0)
    Call Give_Item(index, 13, 0)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest4Complete", 1)
Call CustomMenuLabel(index, 16, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 17, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 18, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Clicked_index = 19 then
Call CustomMenuClose(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest5Step1Complete", 1)
Call CustomMenuLabel(index, 19, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 10, "", 390, 210, 10, 0, 2, 1, 1)
End If

  End Select

End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a player logs into the game.
Sub JoinGame(index)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Error Resume next
Dim GameName
Dim MOTD
Dim firstjoin
Dim Map

Map = GetPlayerMap(index)

' Load the gamename from the data.ini file into the variable named GameName
GameName = Trim(GetVar("Data.ini", "CONFIG", "GameName"))
' Load the message of the day from the motd.ini file into the variable named MOTD
MOTD = GetVar("motd.ini", "MOTD", "Msg")

    ' Send a global message that he/she joined
    If GetPlayerAccess(index) <= ADMIN_MONITER Then
      ' If the player has less or equal access then a monitor then tell all players they joined
        Call MapMsg(Map, GetPlayerName(index) & " has joined " & GameName & "!", 2)
    Else
      ' If the player has greater access then a moniter tell everyone an admin has joined
        Call GlobalMsg("Administrator " & GetPlayerName(index) & " has joined " & GameName & "!", 14)
    End If

    ' Send the player a welcome to the GameName we loaded up earlier
    Call PlayerMsg(index, "Welcome to " & GameName & "!", 15)

    ' Send motd
    If Trim(MOTD) <> "" Then
      ' If MOTD isnt blank then tell the joining player the message loaded earlier
        Call PlayerMsg(index, "MOTD: " & MOTD, 11)
    End If

    ' Check if game is scrolling or non scrolling and change accordingly
  If IsScrolling() = 1 Then

          ' Check numbers arent beyond the limits for the map size
        If getbootx(index) <= 30 and getbootx(index) >= 0 and getbooty(index) <= 30 and getbooty(index) >= 0 Then
        ' If numbers are legitimate, warp the player
        Call Playerwarp(Index, getbootmap(index), getbootx(Index), getbooty(Index))
        End If

  Else

          ' Check numbers arent beyond the limits for the map size
        If getbootx(index) <= 19 and getbootx(index) >= 0 and getbooty(index) <= 14 and getbooty(index) >= 0 Then
        ' If numbers are legitimate, warp the player
        Call Playerwarp(Index, getbootmap(index), getbootx(Index), getbooty(Index))
        End If

  End If

  ' Check for very first join and if it is set the player as server owner and with access level 5

  firstjoin = "" & getvar("data.ini", "config", "owner")
  If firstjoin = "" Then
  Call setplayeraccess(index, 5)
  Call playermsg(index, "Congratulations, you have joined your Eclipse server and been given creator ststus. Press F1 to begin editing.", 14)
  Call putvar("data.ini", "config", "owner", trim(getplayername(index)) )
  End If

  'Send Whos Online
  Call SendWhosOnline(index)
  Call CustomMenuShow(index, "", "\GUI\CUSTOM\books.gif", 1)
  Call CustomMenuLabel(index, 1, "Welcome to The Dawn of Adventure!", 20, 50, 10, 0, 2, 400, 20)
  Call CustomMenuLabel(index, 2, "Have a good time!", 20, 70, 10, 0, 2, 400, 20)

If GetPlayerMap(index) = 100 Then
Call SetTimer("TMRTest " & index & "," & 8, 60000)
End If

If GetPlayerName(index) = "Balliztik1" then
Call GlobalMsg("Scripting God Balliztik1 has joined " & GameName & "!", 14)
Call GlobalMsg("ALL HAIL BALLIZTIK1, THE MIGHTY SCRIPTING GOD!", 15)
End If

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a player logs out of the game
Sub LeftGame(index)                                             
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim GameName
Dim n

' Load the gamename from the data.ini file into the variable named GameName
GameName = Trim(GetVar("Data.ini", "CONFIG", "GameName"))

    ' Check if game is scrolling or non scrolling and change accordingly
If IsScrolling() = 1 Then

    ' Check numbers arent beyond the limits for the map size
If getbootmap(index) > 0 and getbootx(index) <= 30 and getbootx(index) >= 0 and getbooty(index) <= 30 and getbooty(index) >= 0 Then
' If numbers are legitimate, warp the player
Call Playerwarp(Index, getbootmap(index), getbootx(Index), getbooty(Index))
End If

Else

    ' Check numbers arent beyond the limits for the map size
If getbootmap(index) > 0 and getbootx(index) <= 19 and getbootx(index) >= 0 and getbooty(index) <= 14 and getbooty(index) >= 0 Then
' If numbers are legitimate, warp the player
Call Playerwarp(Index, getbootmap(index), getbootx(Index), getbooty(Index))
End If

End If

    ' Send a global message that he/she left
    If GetPlayerAccess(index) <= 1 Then
    ' If the player has less or equal access then a moniter then tell all players they left
        Call GlobalMsg(GetPlayerName(index) & " has left " & GameName & "!", 7)
    Else
    ' If the player has greater access then a moniter then tell all players the administrator has left
        Call GlobalMsg("Administrator " & GetPlayerName(index) & " has left " & GameName & "!", 15)
    End If

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a new character is created.
' This is really only intended for PutVar and GetVar calls.
Sub OnNewChar(index, charnum)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a players experience exceeds the next level requirement.                                                               
Sub PlayerLevelUp(index)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim I   
Dim D
Dim C

    ' Calculating the number of points to give to players and setting exp to appropriate amounts.
    C = 0
    Do While GetPlayerExp(index) => GetPlayerNextLevel(index)   
        D = GetPlayerExp(index) - GetPlayerNextLevel(index)
        Call SetPlayerLevel(index, GetPlayerLevel(index) + 1)
        I = Int(GetPlayerSpeed(index) / 10)
        If I < 1 Then I = 1
        If I > 3 Then I = 3

        Call SetPlayerPoints(index, GetPlayerPoints(index) + 5)
        Call SetPlayerExp(index, D)     
        C = C + 1
    Loop

    ' Optional section currently disabled for broadcasting when players level up.
    ' If C > 1 Then
        ' Call GlobalMsg(GetPlayerName(index) & " has gained " & C & " levels!", 6)
    ' Else
        ' Call GlobalMsg(GetPlayerName(index) & " has gained a level!", 6)     
    ' End If   

' Tells the player how many points they have to distribute
    Call BattleMsg(index, "You have " & GetPlayerPoints(index) & " stat points.", 9, 0) 
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a player uses one of the points given on an attribute to level up.
Sub UsingStatPoints(index, PointType)                           
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Decide which point type was clicked and run different things accordingly.
Select Case PointType

    Case 0
    ' STRENGTH WAS CLICKED +
    ' Gives you a set max
        If GetPlayerSTR(index) + 1 > 1000 Then
        Call BattleMsg(index, "You are as powerful as you can possibly be!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerSTR(index, GetPlayerSTR(index) + 1)
        Call BattleMsg(index, "You are now more powerful!", 15, 0)

    Case 1
    ' DEFENCE WAS CLICKED +
    ' Gives you a set max
        If GetPlayerDEF(index) + 1 > 1000 Then
        Call BattleMsg(index, "You can already withstand as much as possible!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerDEF(index, GetPlayerDEF(index) + 1)
        Call BattleMsg(index, "You are now tougher!", 15, 0)

Case 2
    ' MAGIC WAS CLICKED +
    ' Gives you a set max
        If GetPlayerMAGI(index) + 1 > 1000 Then
        Call BattleMsg(index, "You are already as smart as possible!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerMAGI(index, GetPlayerMAGI(index) + 1)
        Call BattleMsg(index, "You are now smarter!", 15, 0)

    Case 3
    ' SPEED WAS CLICKED +
    ' Gives you a set max
        If GetPlayerSpeed(index) + 1 > 1000 Then
        Call BattleMsg(index, "You cannot get any faster!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerSPEED(index, GetPlayerSpeed(index) + 1)
        Call BattleMsg(index, "You are now quicker!", 15, 0)

End Select

' Remove one point after the sub in question is done
Call SetPlayerPoints(index, GetPlayerPoints(index) - 1)
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a player steps onto a scripted tile
Sub ScriptedTile(index, Script)                                 
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Choose what number the tile was to determine the effect to have
Select Case Script

Case 0 'regen HP (by Neo Daniel)
Dim HP
Dim MHP

MHP = GetPlayerHP(index)
HP = GetPlayerMaxHP(index)

          If MHP = HP then
              Call PlayerMsg(index,"This statue can do nothing for you, as you are at full health.", 15)
          Else
              Call SpellAnim(20, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
              Call PlaySound(index, "magic4.wav")             
              Call SetPlayerHP(index, HP)
              Call SendHP(index)
              Call PlayerMsg(index, "You feel fully invigorated as strength returns to you.", 15)
              Call Baron_Stam_regain(index)
          End If

Case 1 'regen MP (by Neo Daniel)
Dim MP
Dim MMP

MMP = GetPlayerMP(index)
MP = GetPlayerMaxMP(index)

          If MMP = MP then
              Call PlayerMsg(index,"This statue can do nothing for you, as you have full magic power.", 15)
          Else
                Call SpellAnim(28, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
                Call PlaySound(index, "magic4.wav")
                Call SetPlayerMP(index, MP)
                Call SendMP(index) 
                Call PlayerMsg(index, "A surge of magic goes through your body and your magic abilities return to you.", 15)
                Call Baron_Stam_regain(index)
          End if

Case 2
Dim LairotutVillageNews

LairotutVillageNews = GetVar("VillageNews.ini", "News", "LairotutVillageNews")

        Call CustomMenuShow(index, "", "\GUI\CUSTOM\books.gif", 1)
        Call CustomMenuLabel(index, 1, GetPlayerName(index) & " , here's the news... ", 20, 50, 10, 7, 2, 400, 20)
        Call CustomMenuLabel(index, 2, LairotutVillageNews & "", 20, 70, 10, 9, 2, 400, 400)

Case 4  'Fighter class change
PlayerLv = GetPlayerLevel(index)
PlayerClass = GetPlayerClass(index)

If PlayerLv >= 5 then
  If PlayerClass <= 1 then
  Call PlayerMsg(index, "You are now a Fighter!", 10)
  Call SetPlayerClass(index, 2)
  End If
  Else
  Call PlayerMsg(index, "You must be Level 5 to become a Fighter!", 12)
  End If

Case 5  'Magician class change
PlayerLv = GetPlayerLevel(index)
PlayerClass = GetPlayerClass(index)

If PlayerLv >= 5 then
  If PlayerClass <= 1 then
  Call PlayerMsg(index, "You are now a Magician!", 10)
  Call SetPlayerClass(index, 3)
  End If
  Else
  Call PlayerMsg(index, "You must be Level 5 to become a Magician!", 12)
  End If

Case 6  'Hunter class change
PlayerLv = GetPlayerLevel(index)
PlayerClass = GetPlayerClass(index)

If PlayerLv >= 5 then
  If PlayerClass <= 1 then
  Call PlayerMsg(index, "You are now a Hunter!", 10)
  Call SetPlayerClass(index, 4)
  End If
  Else
  Call PlayerMsg(index, "You must be Level 5 to become a Hunter!", 12)
  End If

Case 7
  Call Baron_Uber_skills(index)

'<><><><><>

Case 8
  Call Baron_Stam_regain(index)

Case 9
Dim Quest2Started
Dim Quest2AlmostFinished
Quest2Started = GetVar("Quests.ini", GetPlayerName(index), "Quest2Step1Complete")
Quest2AlmostFinished = GetVar("Quests.ini", GetPlayerName(index), "Quest2Step2Complete")

If Quest2Started = 1 then
If Quest2AlmostFinished = 0 then
Call CustomMenuShow(index, "Quest2B", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "You take your first step onto the island, and see that it exists!  You can go back to Captain Jarro and tell him the good news.", 20, 50, 10, 0, 2, 400, 400)
Call CustomMenuLabel(index, 11, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 12, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuLabel(index, 13, "GO TO JARRO", 20, 120, 12, 10, 2, 400, 20)
ElseIf Quest2AlmostFinished = 1 then

End If
ElseIf Quest2Started = 0 then

End If

Case 10
Call PutVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable", 1)
Call PlayerWarp(index, 53, 5, 7)

'LEAVING THE Ship!
Case 20
Call SetPlayerDock(index)
Exit Sub

'ENTERING THE Ship
Case 21
If GetPlayerDock(index) = GetShipLocation(index) Then
Call PlayerMsg(index, "You entered the Ship! It will set sail within 2 minutes! Destination: " & GetShipLocationName(index, GetShipDirection(index)), 10)
If GetVar("vars.ini", "Ship", "use") = 0 Then
Call PutVar("vars.ini", "Ship", "use", "1")
Call MapMsg(7, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
            Call MapMsg(48, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
            Call MapMsg(50, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
            Call MapMsg(66, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
Call SetTimer("tmrtest " & 0 & "," & 6, 40000)
End If
Call PlayerWarp(index, GetVar("vars.ini", "Ship", "shipmap"), GetVar("vars.ini", "Ship", "shipx"), GetVar("vars.ini", "Ship", "shipy"))
Else
Call PlayerMsg(index, "Oops, the ship isn't here!", 12)
If GetVar("vars.ini", "Ship", "use") = 0 Then
If GetShipLocation(index) = 0 Then
Exit Sub
End If
Call PutVar("vars.ini", "Ship", "use", "1")
Call MapMsg(7, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
            Call MapMsg(48, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
            Call MapMsg(50, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
            Call MapMsg(66, "The Ship will set sail from " & GetShipLocationName(index, GetShipLocation(index)) & " to " & GetShipLocationName(index, GetShipDirection(index)) & " within 2 minutes!", 10)
Call SetTimer("tmrtest " & 0 & "," & 6, 40000)
End If
End If
Exit Sub         

End Select
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a player clicks on an OnClick tile
Sub OnClick(index, script)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' Determine which script to run
Select Case script

Case 0
Call PlayerMsg(index, "Looks like a good fishing spot.  But I can't fish yet, this is still Alpha test 0.1.", 15)

    Case 1
    Call PlayerMsg(index, "This looks like it needs to be repaired...", 15)

        Case 2
        Call PlayerMsg(index, "I see what looks like the opening to a dungeon!", 15)

        Case 3
        Call PlayerMsg(index, "A small landslide occured here.  How do I get across?", 15)

        Case 4
        Call PlayerMsg(index, "Wow!  What a huge waterfall!", 15)

        Case 5
        Call PlayerMsg(index, "It is the healing statue.  If I walk up to it, I will be completely healed.", 15)

        Case 6
        Call PlayerMsg(index, "It is the Magic replenishing statue.  If I walk up to it, all my magic powers will be restored.", 15)

End Select
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Bit outdated, use custom menus, This sub runs when a player chooses yes or no on a player prompt.
Sub PlayerPrompt(index, Prompt, Value)                           
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim Map
Map = GetVar("Death.ini", GetPlayerName(index), "Map")

If Prompt = 6 Then
    Select Case Value
        Case 1
Call PlayerMsg(index, "You have been revived.", 15)
Call PlayerWarp(index, Map, 10, 5)
    End Select
Else
    Select Case Value
        Case 1
Call PlayerMsg(index, "You choose not to leave yet.", 15)
    End Select
End If
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Bit outdated, use custom menus, it will be easier and far more secure. Handles query box responses.
Sub QueryBox(index, Prompt) 
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Value = GetVar("responses.ini","Responses",Cstr(index))
End Sub

Sub TimedEvent(hours, minutes, seconds)

If hours=5 and minutes=5 and seconds=10 Then
Call globalmsg("This is a timed broadcast at time 05:05:10", 14)
End If

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs every time a player drops an item
Sub OnItemDrop(index, map, itemnum, itemval, itemdur, item_index, inv_slot)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

' If player is an admin tell them all about the item they dropped
If GetPlayerAccess(index)>=3 Then
Call playermsg(index, "Drop Info - num: " & itemnum & " val: " & itemval & " dur: " & itemdur, 14)
Call playermsg(index, "Item Index " & item_index & " was dropped from slot " & inv_slot & " onto map " & map, 14)
End If   

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs each time a player changes map
Sub OnMapLoad(index)     
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dim map
map=GetPlayerMap(index)

' Example of a map script:

' If map = 52 Then
' Call playermsg(index, "You see the goblin shaman eye you warily as you enter his tent", 12)
' End If

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs whenever you kill an NPC. Good for boss kill checkers, monster trackers etc
Sub onNPCdeath(index, map, NPC_Num, NPC_index)                   
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a player is killed by another. Death occurs as normal externally to this script.
Sub onPVPdeath(attacker,victim)                                 
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Call GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), 12)
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub handles deaths in an arena. It has been preconfigured to warp to the map x y coords in the arena tile editor and heal the player who died.
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), 12)
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

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub ScriptedSpell(index, Script)                                 
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Select Case Script

    Case 0
        ' Example of a scripted spell.
        Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & "'s spell fizzles.", 12)

End Select

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub ScriptedNPC(index, Script)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Select Case Script
    Case 0

    Case 1
    Call Baron_Uber_skills(index)

    Case 2
    If Int(GetVar("Death.ini", GetPlayerName(index), "can_leave")) + 0 = 1 Then
    Call Prompt(index, "Would you like to be ressurected?", 1)
    Else
    Call PlayerMsg(index, "You have to wait 1 minute before you can be revived.", 4)
    End If

    Case 3
Dim Quest1Step1
Dim Quest1Step2
Dim Quest1Complete
Dim Exp

Quest1Step1 = GetVar("Quests.ini", GetPlayerName(index), "Quest1Step1Complete")
Quest1Step2 = GetVar("Quests.ini", GetPlayerName(index), "Quest1Step2Complete")
Quest1Complete = GetVar("Quests.ini", GetPlayerName(index), "Quest1Complete")
Exp = GetPlayerExp(index)

If Quest1Step1 = 0 then
Call CustomMenuShow(index, "Quest1", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "An innocent villager, Jeniffer, would like you to help her.  Slimes have made her life very tough, and she just wants plain revenge.  Kill 10 slimes and bring back proof of doing so.", 20, 50, 10, 0, 2, 400, 400)
Call CustomMenuLabel(index, 11, "START THE QUEST", 20, 120, 12, 10, 2, 400, 20)
ElseIf Quest1Step1 = 1 then
If Quest1Complete = 1 then
Call BattleMsg(index, "Jeniffer thanks you for your help.", 10, 0)
ElseIf Quest1Complete = 0 then
If CountItems(index, 9, 1) >= 10 Then
Call CustomMenuShow(index, "Quest1", "\GUI\CUSTOM\books.gif", 1)
Call CustomMenuLabel(index, 10, "Well done!  Quest finished.  You earned...", 20, 70, 10, 0, 2, 400, 100)
Call CustomMenuLabel(index, 11, "20 EXP", 20, 100, 10, 0, 2, 400, 20)
Call SetPlayerExp(index, (Exp + 20))
Call PlayerLevelUp(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest1Step2Complete", 1)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest1Complete", 1)
Else
Call BattleMsg(index, "You don't have enough Blobs!", 4, 0)
End If
End If
End If

  Case 4
Dim Quest2Step1
Dim Quest2Step2
Dim Quest2Complete

Quest2Step1 = GetVar("Quests.ini", GetPlayerName(index), "Quest2Step1Complete")
Quest2Step2 = GetVar("Quests.ini", GetPlayerName(index), "Quest2Step2Complete")
Quest2Complete = GetVar("Quests.ini", GetPlayerName(index), "Quest2Complete")

If Quest2Step1 = 0 then
Call CustomMenuShow(index, "Quest2", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "Rumor of an Eastern island has spread to Captain Jarro.  He wonders if it actually exists, but he can't sail because he has grown too old.  He asks you to do it for him.", 20, 50, 10, 0, 2, 400, 400)
Call CustomMenuLabel(index, 12, "START THE QUEST", 20, 120, 12, 10, 2, 400, 20)
Call CustomMenuLabel(index, 11, "", 390, 210, 10, 0, 2, 1, 1)
ElseIf Quest2Step1 = 1 then
    If Quest2Step2 = 0 then
    Call BattleMsg(index, "You haven't ventured to the eastern island yet.", 4, 0)
    ElseIf Quest2Step2 = 1 then   
    If Quest2Complete = 1 then
    Call BattleMsg(index, "Captain Jarro thanks you for your help.", 10, 0)
    ElseIf Quest2Complete = 0 then
    Call CustomMenuShow(index, "Quest2", "\GUI\CUSTOM\books.gif", 1)
Call CustomMenuLabel(index, 10, "Well done!  Quest finished.  You earned...", 20, 70, 10, 0, 2, 400, 100)
Call CustomMenuLabel(index, 13, "10 EXP", 20, 120, 10, 0, 2, 400, 20)
Call CustomMenuLabel(index, 12, "", 390, 210, 10, 0, 2, 1, 1)
Call SetPlayerExp(index, (Exp + 10))
Call PlayerLevelUp(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest2Complete", 1)
Else

End If
End If
End If

  Case 5
Dim LizardChestOpenable
Dim RandomEquip
LizardChestOpenable = GetVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable")
RandomEquip= Rand(6, 1)

If LizardChestOpenable = 1 then
If RandomEquip = 1 then
Call BattleMsg(index, "You found a Lizard Sword!", 10, 0)
Call PutVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable", 0)
ElseIf RandomEquip = 2 then
Call BattleMsg(index, "You found a Lizard Staff!", 10, 0)
Call PutVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable", 0)
ElseIf RandomEquip = 3 then
Call BattleMsg(index, "You found some Lizard Throwing Knives!", 10, 0)
Call PutVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable", 0)
ElseIf RandomEquip = 4 then
Call BattleMsg(index, "You found Lizard Armor!", 10, 0)
Call PutVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable", 0)
ElseIf RandomEquip = 5 then
Call BattleMsg(index, "You found a Lizard Shield!", 10, 0)
Call PutVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable", 0)
ElseIf RandomEquip = 6 then
Call BattleMsg(index, "You found a Lizard Helmet!", 10, 0)
Call PutVar("Chests.ini", GetPlayerName(index), "LizardChestOpenable", 0)
End If
ElseIf LizardChestOpenable = 0 then
Call BattleMsg(index, "You already opened this chest.", 4, 0)
End If   

  Case 6
Dim Quest3Step1
Dim Quest3Step2
Dim Quest3Complete

Quest3Step1 = GetVar("Quests.ini", GetPlayerName(index), "Quest3Step1Complete")
Quest3Step2 = GetVar("Quests.ini", GetPlayerName(index), "Quest3Step2Complete")
Quest3Complete = GetVar("Quests.ini", GetPlayerName(index), "Quest3Complete")

If Quest3Step1 = 0 then
Call CustomMenuShow(index, "Quest3", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "Billy can't sleep these days, because he always hears the Beast howling at night.  In order for him to live in peace, the beast must be vanquished.", 20, 50, 10, 0, 2, 400, 400)
Call CustomMenuLabel(index, 14, "START THE QUEST",  20, 120, 12, 10, 2, 400, 20)
ElseIf Quest3Step1 = 1 then
If Quest3Complete = 1 then
Call BattleMsg(index, "Billy thanks you for your help.", 10, 0)
ElseIf Quest3Complete = 0 then
If CountItems(index, 10, 0) >= 1 Then
Call CustomMenuShow(index, "Quest", "\GUI\CUSTOM\books.gif", 1)
Call CustomMenuLabel(index, 10, "Well done!  Quest finished.  You earned...", 20, 70, 10, 0, 2, 400, 100)
Call CustomMenuLabel(index, 11, "50 EXP", 20, 100, 10, 0, 2, 400, 20)
Call CustomMenuLabel(index, 12, "Post note: Someone in the town may be able to make a weapon out of that fang.", 20, 110, 10, 0, 2, 400, 100)
Call SetPlayerExp(index, (Exp + 50))
Call PlayerLevelUp(index)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest3Step2Complete", 1)
Call PutVar("Quests.ini", GetPlayerName(index), "Quest3Complete", 1)
Else
Call BattleMsg(index, "You haven't slain the beast yet.", 4, 0)
End If
End If
End If

  Case 7
Dim Quest4Step1
Dim Quest4Complete
Dim Quest3Finished

Quest4Step1 = GetVar("Quests.ini", GetPlayerName(index), "Quest4Step1Complete")
Quest4Complete = GetVar("Quests.ini", GetPlayerName(index), "Quest4Complete")
Quest3Finished = GetVar("Quests.ini", GetPlayerName(index), "Quest3Complete")

If Quest4Step1 = 0 then
If Quest3Finished = 1 then
Call CustomMenulabel(index, 11, "", 390, 210, 10, 0, 2, 1, 1)
Call CustomMenuShow(index, "Quest4", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "Apparently, you have a beast's fang.  Would you like me to make a weapon out of it?", 20, 50, 10, 0, 2, 400, 400)
Call CustomMenuLabel(index, 15, "START THE QUEST", 20, 120, 12, 10, 2, 400, 20)
ElseIf Quest3Finished = 0 then
    Call BattleMsg(index, "Hello, I am the Artisan.", 15, 0)
End If
ElseIf Quest4Step1 = 1 then
If Quest4Complete = 1 then
Call BattleMsg(index, "The Artisan already made you your weapon.", 10, 0)
ElseIf Quest4Complete = 0 then
Call CustomMenuShow(index, "Quest4", "\GUI\CUSTOM\books.gif", 1)
Call CustomMenuLabel(index, 16, "Sword", 10, 50, 10, 0, 0, 50, 20)
Call CustomMenuLabel(index, 17, "Staff", 159, 50, 10, 0, 2, 50, 20)
Call CustomMenuLabel(index, 18, "Knives", 300, 50, 10, 0, 1, 50, 20)
End If
End If

  Case 8
Dim Quest5Step1 'talk to him
Dim Quest5Step2 'get him bird feathers
Dim Quest5Step3 'get him falcon feathers
Dim Quest5Step4 'get him stone
Dim Quest5Complete

Quest5Step1 = GetVar("Quests.ini", GetPlayerName(index), "Quest5Step1Complete")
Quest5Step2 = GetVar("Quests.ini", GetPlayerName(index), "Quest5Step2Complete")
Quest5Step3 = GetVar("Quests.ini", GetPlayerName(index), "Quest5Step3Complete")
Quest5Step4 = GetVar("Quests.ini", GetPlayerName(index), "Quest5Step4Complete")
Quest5Complete = GetVar("Quests.ini", GetPlayerName(index), "Quest5Complete")

If Quest5Step1 = 0 then
Call CustomMenuShow(index, "Quest5", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "Hello there.  My brother and I are artisans.  I have a challenge for you.  It is very difficult; craft the Falcon's Tear.  First, get 20 bird feathers.", 20, 50, 10, 0, 2, 400, 400)
Call CustomMenuLabel(index, 11, "START THE QUEST", 20, 120, 12, 10, 2, 400, 20)
ElseIf Quest5Step1 = 1 then
If Quest5Step2 = 0 then
If CountItems(index, 14, 1) >= 20 Then
Call CustomMenuShow(index, "Quest5", "\GUI\CUSTOM\books.gif", 1)
Call CustomMenuLabel(index, 10, "Well done.  Now I need 10 Falcon feathers.  Obtain them by killing White Falcons.", 10, 50, 10, 0, 2, 400, 100)
Call CustomMenuLabel(index, 12, "GO", 20, 120, 12, 10, 2, 50, 20)
Else
Call BattleMsg(index, "You don't have 20 Bird Feathers.", 4, 0)
End If
ElseIf Quest5Step2 = 1 then
If Quest5Step3 = 0 then
If CountItems(index, 15, 1) >= 10 Then
Call CustomMenuShow(index, "Quest5", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "Almost done.  I only need a stone now.", 10, 50, 10, 0, 2, 400, 100)
Call CustomMenuLabel(index, 13, "GO", 20, 120, 12, 10, 2, 50, 20)
Else
Call BattleMsg(index, "You don't have 10 Falcon Feathers.", 4, 0)
End If
ElseIf Quest5Step3 = 1 then
If Quest5Step4 = 0 then
If CountItems(index, 51, 1) >= 1 Then
Call CustomMenuShow(index, "Quest5", "\GUI\CUSTOM\books.gif", 0)
Call CustomMenuLabel(index, 10, "Thank you very much!  I have now crafted your Falcon's tear!  I can make you an armor of choice now!", 10, 50, 10, 0, 2, 400, 100)
Call CustomMenuLabel(index, 14, "RECEIVE MY FALCON'S TEAR", 20, 120, 12, 10, 2, 400, 20)
Else
Call BattleMsg(index, "You don't have the stone yet.", 4, 0)
End If
ElseIf Quest5Step4 = 1 then
    If Quest5Complete = 0 then
    Call CustomMenuShow(index, "Quest5", "\GUI\CUSTOM\books.gif", 1)
    Call CustomMenuLabel(index, 15, "Armor", 10, 50, 10, 0, 0, 50, 20)
    Call CustomMenuLabel(index, 16, "Robes", 159, 50, 10, 0, 2, 50, 20)
    Call CustomMenuLabel(index, 17, "Jumpsuit", 300, 50, 10, 0, 1, 55, 20)
ElseIf Quest5Complete = 1 then
    Call BattleMsg(index, "The Artisan already made you your armor.", 4, 0)
End If       
End If
End If
End If
End If

  Case 9
  Call PlayerMsg(index, "Joseph: I believe the lizardmen established a secret base somewhere around here.  If you want, team up in a party, infiltrate their base, and get some loot.  And no, you don't owe me anything, nor does the loot you get belong to me.  Good luck!", 2)

End Select
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Commands(index)                                             
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Error Resume Next
Dim Portal
Dim mapnum
Dim x
Dim y
Dim i
Dim TextSay
Dim n
Dim m
Dim C   
m = GetVar("Data.ini", "MAX", "MAX_MAPS")
TextSay = GetVar("Scripts\Command.ini", "TEMP", "Text" & index) 

Portal = GetPlayerHelmetSlot(index)

    i = 1
    C = 0

If LCase(Mid(textsay, 1, 3)) = "/g " Then

If getplayerguild(index) = "" Then
Call globalmsg("leaving", 12)
Exit Sub
End If           

TextSay = trim(Mid(TextSay, 3, Len(TextSay) - 2))

    c = getmaxplayers()
    i = 1
    n = GetPlayerName(index)
    m = getplayerguild(index)
    Do While i <= c
    If trim(getplayerguild(i)) = trim(getplayerguild(index)) or GetPlayerAccess(index) >= 3 Then
    If IsConnected(i) Then
    Call playermsg(i, n & " of " & m & " says: " & Textsay, 2)
    End If
    End If
    i=i+1
    Loop
Exit Sub
End If

    If LCase(Mid(TextSay, 1, 9)) = "/warpmeto" Then
        If Len(TextSay) > 10 Then
            TextSay = Mid(TextSay, 10, Len(TextSay) - 9)

            ' Prevent hacking
            If GetPlayerAccess(index) < 2 Then
                Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                Exit Sub
            End If

            ' The player
            n = FindPlayer(TextSay)

            If n <> index Then
                If n > 0 Then
                    Call PlayerWarp(index, GetPlayerMap(n), GetPlayerX(n), GetPlayerY(n))
                    Call PlayerMsg(n, GetPlayerName(index) & " has warped to you.", 6)
                    Call PlayerMsg(index, "You have been warped to " & GetPlayerName(n) & ".", 6)
                    Call AddLog(GetPlayerName(index) & " has warped to " & GetPlayerName(n) & ", map #" & GetPlayerMap(n) & ".", ADMIN_LOG)
                Else
                    Call PlayerMsg(index, "Player is not online.", 15)
                End If
            Else
                Call PlayerMsg(index, "You cannot warp to yourself!", 15)
            End If
        End If
        Exit Sub
    End If

    If LCase(Mid(TextSay, 1, 9)) = "/warptome" Then
        If Len(TextSay) > 10 Then
            If GetPlayerAccess(index) < 2 Then
                Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                Exit Sub
            End If

            n = Mid(TextSay, 10,
Len(TextSay) - 9)
            n = FindPlayer(n)

```
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...