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

A bit of help please


headswe
 Share

Recommended Posts

i have installed the "Startup items" and the class advancements script but none of them are working so i tought id post my main here for a bit of help.

edit: also im useing EE2.5

```
'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 runs whenever a new character is created.
'  Warning: This is intended for creating new values, etc. only.
'  The player is NOT logged into the game when this runs, so commands
'  such as PlayerMsg will NOT work!
Sub OnNewChar(index, charNum)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' 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)                                               
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

if EquippedWeapon(index) = 2 Then
Call PlaySound(index, "laser.wav")
end if

if EquippedWeapon(index) = ITEM_NUMBER Then
Call PlaySound(index, "Sniper.wav")
end if
End Sub

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

End Sub

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

End Sub

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

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when players press the PageDown key
Sub HotScript4(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
' Player has clicked a picture box whos number is clicked_index on the custom menu named menu_title
Call playermsg(index, "Clicked  picture number " & clicked_index & " on the menu named " & menu_title, 14)

Case 2
' FIELD WAS CLICKED   
' Player has clicked a text field OK button whos number is clicked_index on the custom menu named menu_title.
Call playermsg(index, "Clicked  field number " & clicked_index & " on the menu named " & menu_title & ". The field text was " & field_message, 14)

Case 3
' LABEL WAS CLICKED
' Player has clicked a label button whos number is clicked_index on the custom menu named menu_title
Call playermsg(index, "Clicked  label number " & clicked_index & " on the menu named " & menu_title, 14)

End Select

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when a player logs into the game.
Sub JoinGame(index) 
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If GetVar("var.ini", GetPlayerName(index), "startup") = "" Then

weapon = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Weapon"))
armor = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Armor"))
shield = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Shield"))
helmet = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Helmet"))
wepdur = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Wepdur"))
armdur = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Armdur"))
shldur = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Shldur"))
hlmdur = Int(GetVar("classes\class" & GetPlayerClass(index) & ".ini", "StartUp", "Hlmdur"))

If weapon <> 0 Then
Call Give_Item(index, weapon, wepdur)
End If
If armor <> 0 Then
Call Give_Item(index, armor, armdur)
End If
If shield <> 0 Then
Call Give_Item(index, shield, shldur)
End If
If helmet <> 0 Then
Call Give_Item(index, helmet, hlmdur)
End If

Call PutVar("var.ini", GetPlayerName(index), "startup", "yes")
End If

On Error Resume next
Dim GameName
Dim MOTD
Dim firstjoin

' 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 GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 7)
    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

'Send Whos Online
Call SendWhosOnline(index)
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 players experience exceeds the next level requirement.                                                               
Sub PlayerLevelUp(index)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If GetPlayerLevel(Index) = 20 Then
        Call PlayerMsg(Index, "You need to advance before you can continue your training!!!", 4)
        Exit Sub
    End If

    If GetPlayerLevel(Index) = 40 Then
      If GetPlayerClass(index) > 2 And GetPlayerClass(index) < 6 Then
        Call PlayerMsg(Index, "You need to advance before you can continue your training!!!", 4)
        Exit Sub
      End If
    End If

    If GetPlayerLevel(Index) = 60 Then
      If GetPlayerClass(index) > 5 And GetPlayerClass(index) < 9 Then
        Call PlayerMsg(Index, "You need to advance before you can continue your training!!!", 4)
        Exit Sub
      End If
    End If

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) + I)
        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 have maxed your firepower!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerSTR(index, GetPlayerSTR(index) + 1)
        Call BattleMsg(index, "You have gained more firepower!", 15, 0)

    Case 1
    ' DEFENCE WAS CLICKED +
    ' Gives you a set max
        If GetPlayerDEF(index) + 1 > 1000 Then
        Call BattleMsg(index, "You have maxed your armor!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerDEF(index, GetPlayerDEF(index) + 1)
        Call BattleMsg(index, "You have gained more armor!", 15, 0)

Case 2
    ' MAGIC WAS CLICKED +
    ' Gives you a set max
        If GetPlayerMAGI(index) + 1 > 1000 Then
        Call BattleMsg(index, "You have maxed your nano skills!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerMAGI(index, GetPlayerMAGI(index) + 1)
        Call BattleMsg(index, "You have gained more nano abilities!", 15, 0)

    Case 3
    ' SPEED WAS CLICKED +
    ' Gives you a set max
        If GetPlayerSpeed(index) + 1 > 1000 Then
        Call BattleMsg(index, "You have maxed your speed!", 12, 0)
        Exit Sub
        End If
        Call SetPlayerSPEED(index, GetPlayerSpeed(index) + 1)
        Call BattleMsg(index, "You have gained more speed!", 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
    Call PutVar("Scripts\Charextras\test.ini", "TEST", "TEST", "TEST")
Call Playermsg(index, "You feel like you should have seen something happen when you stood here", 14)
        End If

    Case 1
        Call Advancement(index)

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, "You clicked a tile!", 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)                           
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If Prompt = 6 Then
    Select Case Value
        Case 0
            Call GlobalMsg("Hi This is a Yes answer!", 3)
        Case 1
            Call GlobalMsg("This is case 1?", 3)
    End Select
Else
    Select Case Value
        Case 0
            Call GlobalMsg("Hi This is a No answer!", 4)
        Case 1
            Call GlobalMsg("This is no case 1?", 4)
    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)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

End Sub

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

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)                   
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

Call BattleMsg(index, "You killed a " & getnpcname(NPC_Num), 12, 0)
End Sub

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

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
'Call playermsg(index, "Welcome to my store", 15)
'Call goshopping(index,1)
Exit Sub

Case Else

Case 1
Call Advancement(index)

End Select

End Sub

'Runs whenever a key has been pressed
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Keys(index, keyNum)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Select Case keyNum
'Do what you want here
End Select
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Commands(index)                                             
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If LCase(Mid(TextSay, 1, 9)) = "/advance" Then
Call AdvanceMent(Index)
Exit Sub

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, 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)

            If n <> index Then
                If n > 0 Then

                    Call PlayerWarp(n, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
                    Call PlayerMsg(n, "You have been summoned by " & GetPlayerName(index) & ".", 9)
                    Call PlayerMsg(index, GetPlayerName(n) & " has been summoned.", 9)
                    'Call AddLog(GetPlayerName(index) & " has warped " & GetPlayerName(n) & " to self, map #" & GetPlayerMap(index) & ".", ADMIN_LOG)
                Else
                    Call PlayerMsg(index, "Player is not online.", 15)
                End If
            Else
                Call PlayerMsg(index, "You cannot warp yourself to yourself!", 15)
            End If
        End If
        Exit Sub
    End If

    If LCase(Mid(TextSay, 1, 7)) = "/warpto" Then
        If Len(TextSay) > 8 Then
            TextSay = Mid(TextSay, 8, Len(TextSay) - 7)
            n = TextSay

            If n > 0 and n <= m Then
                If GetPlayerAccess(index) < 2 Then
                    Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                    Exit Sub
                End If

                'If Getattribute(GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)) <> 1 Then

                Call SpellAnim(1, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
                Call PlayerWarp(index, n, GetPlayerX(index), GetPlayerY(index))
                Call SpellAnim(1, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
                Call PlayerMsg(index, "You have been warped to map #" & n, 9)
                'Call AddLog(GetPlayerName(index) & " warped to map #" & n & ".", ADMIN_LOG)
            Else
                Call PlayerMsg(index, "Invalid map number.", 4)
            End If
        End If
        Exit Sub
    End If

    If LCase(Trim(TextSay)) = "/help" Then
        Call PlayerMsg(index, "Social Commands:", 15)
        Call PlayerMsg(index, "'msghere = Broadcast Message", 15)
        Call PlayerMsg(index, "-msghere = Emote Message", 15)
        Call PlayerMsg(index, "!namehere msghere = Player Message", 15)
        Call PlayerMsg(index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", 15)
    Exit Sub
    End If

    If LCase(Trim(TextSay)) = "/calladmins" Then
        If GetPlayerAccess(index) = 0 Then
            Call GlobalMsg(GetPlayerName(index) & " needs an admin!", 10)
        Else
            Call PlayerMsg(index, "You are an admin!", 10)
        End If
    Exit Sub
    End If

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

Select Case LCase(Trim(TextSay))   
    Case "/away"
        'If GetPlayerAccess(index) >= 1 Then
            If GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 0 Then
                Call GlobalMsg(GetPlayerName(index) & " is now away.", 14)
                Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 1)
                Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName", GetPlayerName(index))
                Call SetPlayerName(index, GetPlayerName(index) & " - Away")
                Call SendPlayerData(index)
                Exit Sub
            ElseIf GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 1 Then
                Call SetPlayerName(index, GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName"))
                Call GlobalMsg(GetPlayerName(index) & " has returned from being away.", 14)
                Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 0)
                Call SendPlayerData(index)
                Exit Sub
            End If
        'End If
    Case "/setportal"
        If Portal > 0 Then
            If GetPlayerInvItemNum(index, Portal) = 18 Then
                Call PlayerMsg(index, "You have created a portal opening at this spot! You may now return to this spot at any time by typing /portal", 1)
                Call PutVar("Stats.ini", GetPlayerName(index), "map", GetPlayerMap(index))
                Call PutVar("Stats.ini", GetPlayerName(index), "x", GetPlayerX(index))
                Call PutVar("Stats.ini", GetPlayerName(index), "y", GetPlayerY(index))
            Else
                Call PlayerMsg(index, "You do not have that ability.", 4)
            End If
            Exit Sub
        End If
    Case "/portal"
        If Portal > 0 Then
        mapnum = GetVar("Stats.ini", GetPlayerName(index), "map")
        y = GetVar("Stats.ini", GetPlayerName(index), "y")
        x = GetVar("Stats.ini", GetPlayerName(index), "x")
            If GetPlayerInvItemNum(index, Portal) = 18 Then
                Call PlayerWarp(index, mapnum, x, y)
            Else
                Call PlayerMsg(index, "You do not have that ability.", 4)
            End If
            Exit Sub
        End If 

End Select

Call PlayerMsg(index, "Thats not a valid command!", 12)
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub deals with dropping items on death. By default drops are disabled.
Sub DropItems(index)                                             
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub is run whenever somebody dies outside of an arena.
Sub OnDeath(index)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim mapnum
Dim x
Dim y
Dim i
i = GetPlayerClass(index)

mapnum = GetVar("Classes\Class" & i & ".ini", "CLASS", "Map")
y = GetVar("Classes\Class" & i & ".ini", "CLASS", "y")
x = GetVar("Classes\Class" & i & ".ini", "CLASS", "x")

Call PlayerWarp(index, 1, 10, 10)
End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub is run when a scripted item is used or double clicked.
Sub ScriptedItem(index, Script)                                 
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Select Case Script

    Case 0     
        Call playermsg(index, "No script found. Please contact an admin to solve this problem.", 15)
        Call AdvanceMent(Index)
Exit Sub

Case Else
'No script found
Call playermsg(index, "No script found. Please contact an admin to solve this problem.", 15)
Exit Sub

End Select

End Sub

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Handles custom timer events.
Sub TMRTEST(index, script)                                       
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Select Case script

Case 0
Call playermsg(index, "Timed event occuring.", 12)
Call Removetimer("tmrtest " & index & "," & script)       

Case Else
Call playermsg(index, "No timer found, please contact an admin to resolve this issue.", 12)
Call Removetimer("tmrtest " &index & "," & script)

End Select

End Sub

Function EquippedWeapon(index)
If GetPlayerWeaponSlot(index) = 0 Then
EquippedWeapon = 0
Else
EquippedWeapon = GetPlayerInvItemNum(index, GetPlayerWeaponSlot(index))
End If
End Function

'********************************
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

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub AdvanceMent(Index)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim CurrentClass
Dim NextClass
Dim ClassName
Dim Advance
Dim Str
Dim Def
Dim Speed
Dim Magi
CurrentClass = GetPlayerClass(Index)

Advance = 0

If GetPlayerLevel(Index) = 20 Then
    If GetPlayerClass(Index) < 3 Then
        Advance = 1
    End If
End If

If GetPlayerLevel(Index) = 40 Then
    If GetPlayerClass(Index) > 2 Then
        If GetPlayerClass(Index) < 6 Then
            Advance = 2
        End If
    End If
End If

If GetPlayerLevel(Index) = 60 Then
    If GetPlayerClass(Index) > 5 Then
        If GetPlayerClass(Index) < 9 Then
            Advance = 3
        End If
    End If
End If

If GetPlayerLevel(Index) > 60 Then
    Call PlayerMsg(Index, "All you need is training!", 4)
    Exit Sub
End If

If Advance = 0 Then
    Call PlayerMsg(Index, "You need to further your skills before advancing!", 4)
    Exit Sub
End If

NextClass = CurrentClass + 3 '  +

Str = GetVar("Classes\Class" & NextClass & ".ini", "CLASS", "STR")
Def = GetVar("Classes\Class" & NextClass & ".ini", "CLASS", "DEF")
Magi = GetVar("Classes\Class" & NextClass & ".ini", "CLASS", "MAGI")
Speed = GetVar("Classes\Class" & NextClass & ".ini", "CLASS", "SPEED")

Call SetPlayerStr(Index, Int(GetPlayerStr(Index) + Str))
Call SetPlayerDef(Index, GetPlayerDef(Index) + Def)
Call SetPlayerSpeed(Index, GetPlayerSpeed(Index) + Speed)
Call SetPlayerMAGI(Index, GetPlayerMagi(Index) + Magi)

If GetPlayerGender(Index) = 0 Then
    Call SetPlayerSprite(Index, GetVar("Classes\Class" & NextClass & ".ini", "Class", "MaleSprite"))
Else
    Call SetPlayerSprite(Index, GetVar("Classes\Class" & NextClass & ".ini", "Class", "FemaleSprite"))
End If

ClassName = GetVar("Classes\Class" & NextClass & ".ini", "CLASS", "Name")
Call SetPlayerClass(Index, NextClass)
Call PlayerMsg(Index, "You have become a " & ClassName & "!!!", 10)

Call SendStats(Index)
Call SendPlayerData(Index)

End Sub

```

thanks for any help
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...