Dastyruck
-
Posts
128 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Calendar
Posts posted by Dastyruck
-
-
LOTS of syntax errors, but, they are all gone, I didnt look through all of it, but your syntax is fixed…
```
' 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)
If GetPlayerClass(index) = 0 Then
Call SetPlayerSpell(index, 1, 1)
End If
If GetPlayerClass(index) = 1 Then
Call SetPlayerSpell(index, 1, 1)
End If
If GetPlayerClass(index) = 2 Then
Call SetPlayerSpell(index, 1, 1)
End If
If GetPlayerClass(index) = 3 Then
Call SetPlayerSpell(index, 1, 1)
Call SetPlayerSpell(index, 2, 2)
End If
If GetPlayerClass(index) = 4 Then
Call SetPlayerSpell(index, 1, 1)
End If
If GetPlayerClass(index) = 5 Then
Call SetPlayerSpell(index, 1, 1)
End If
If GetPlayerClass(index) = 6 Then
Call SetPlayerSpell(index, 1, 1)
End If
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("Visit www.fused-creations.com/Viri/Games for more of my games", 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 3
If Clicked_Index = 21 Then
If GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 0 Then
Call PlayerWarp(Index, 99, 1, 1)
Call PutVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used", 1)
Call PutVar("Scripts\charextras\" & GetPlayerName(Index) & ".ini", "MINIGAMES", "Game1", 1)
Call PutVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Timer", 60)
Call SetTimer("SlymeHunterTimer " & index, 1000)
Call PlayerMsg(Index, "You joined Slyme Hunter!", GREEN)
Call CustomMenuClose(Index)
ElseIf GetVar("Scripts\Minigames.ini", "SLYMEHUNTER", "Game1Used") = 1 Then
Call PlayerMsg(Index, "Somebody has already joined Slyme Hunter!", GREEN)
End If
End If
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
Call BattleMsg(Index, "You have " & GetPlayerPOINTS(Index) & " stat points.", BRIGHTBLUE, 0)
End Sub
' Executes when a player uses one of the points given on an attribute to level up.
Sub UsingStatPoints(Index, PointType)
Select Case PointType
Case 0
If GetPlayerSTR(Index) + 1 > 1000 Then
Call BattleMsg(Index, "You have maxed your strength!", BRIGHTRED, 0)
Exit Sub
End If
Call SetPlayerSTR(Index, GetPlayerSTR(Index) + 1)
Call BattleMsg(Index, "You have gained more strength!", WHITE, 0)
Case 1
If GetPlayerDEF(Index) + 1 > 1000 Then
Call BattleMsg(Index, "You have maxed your defence!", BRIGHTRED, 0)
Exit Sub
End If
Call SetPlayerDEF(Index, GetPlayerDEF(Index) + 1)
Call BattleMsg(Index, "You have gained more defense!", WHITE, 0)
Case 2
If GetPlayerMAGI(Index) + 1 > 1000 Then
Call BattleMsg(Index, "You have maxed your magic!", BRIGHTRED, 0)
Exit Sub
End If
Call SetPlayerMAGI(Index, GetPlayerMAGI(Index) + 1)
Call BattleMsg(Index, "You have gained more magic!", WHITE, 0)
Case 3
If GetPlayerSPEED(Index) + 1 > 1000 Then
Call BattleMsg(Index, "You have maxed your speed!", BRIGHTRED, 0)
Exit Sub
End If
Call SetPlayerSPEED(Index, GetPlayerSPEED(Index) + 1)
Call BattleMsg(Index, "You have gained more speed!", WHITE, 0)
End Select
' Remove one point after the sub in question is done
Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) - 1)
End Sub
' Executes when a player steps onto a scripted tile.
Sub ScriptedTile(Index, Script)
Select Case Script
Case 0
Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE)
Exit Sub
Case 1
If GetPlayerLvl(index) >= 5 Then
Call SetBlock(map, X, Y)
Call SetAttribute(map, X, Y)
Call PlayerMsg(index, "You cannot become a Heavy Blade Adept Rouge yet![lvl 5 + needed]", 15)
Else
If GetPlayerLvl(index) <= 4 Then
Call PlayerMsg(index, "Welcome to the Heavy Blade Adept Rouge Transfromation area", 15)
End If
End If
Case 2
If GetPlayerLvl(index) >= 10 Then
Call SetBlock(map, X, Y)
Call SetAttribute(map, X, Y)
Call PlayerMsg(index, "You cannot become a Wavemaster Adept Rouge yet![lvl 10 + needed]", 15)
Else
If GetPlayerLvl(index) <= 9 Then
Call PlayerMsg(index, "Welcome to the Wavemaster Adept Rouge Transfromation area", 15)
End If
End If
Case 3
If GetPlayerLvl(index) >= 15 Then
Call SetBlock(map, X, Y)
Call SetAttribute(map, X, Y)
Call PlayerMsg(index, "You cannot become a Pole Arm Adept Rouge yet![lvl 15 + needed]", 15)
Else
If GetPlayerLvl(index) <= 14 Then
Call PlayerMsg(index, "Welcome to the Pole Arm Adept Rouge Transfromation area", 15)
End If
End If
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
' Executes whenever an NPC is killed.
' Note: Death occurs as normal externally to this script.
Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex)
Dim NpcStuff
NpcStuff = GetVar("NpcInfo.ini", NPCNum & "", "Reputation")
Select Case NpcStuff
Case "Good"
Call LowerRep(Index)
Call PlayerMsg(Index, "You killed a good NPC", RED)
Case "Evil"
Call RaiseRep(Index)
Call PlayerMsg(Index, "You killed an evil NPC", RED)
Case Else
' nothing XD
End Select
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 1
MsgBox "I'm the quest tester. Please get me 50 (money).", 0, "Quest Start"
If CanTake(Index, 1, 50) = False Then
Call PlayerMsg(index, "You don't have the items required!", 12)
Else
Dim Exp
Call TakeItem(index, 1, 50)
Call GiveCurrency(index, 1, 500)
Call PlayerMsg(index, "Thanks; here's your reward!", 12)
Exp = GetPlayerExp(index)
Call SetPlayerExp(index, Exp + 50)
Call PlayerMsg(index, "You've gained 50 experience and got 500 (money)!", 12)
Call SendStats(Index)
End If
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 <= 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
If GetPlayerAccess(Index) < 1 Then
Call PlayerMsg(Index, "You are not an admin!", BRIGHTRED)
End If
End If
Exit Sub
Case "/reputation"
Call PlayerMsg(Index, "Your reputation is " & GetRep(Index), WHITE)
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 0
Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE)
Exit Sub
Case 1
Case 2
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
' Tests scripts up to the location of Sub TestMain(Index).
Function GetFreeSlots(Index)
Dim Slot
Dim Slots
Slot = 1
Slots = 0
Index = Int(Index)
Do While Slot < 25
If GetPlayerInvItemNum(Index, Slot) = 0 Then
Slots = Slots + 1
End If
Slot = Slot + 1
Loop
GetFreeSlots = Slots
End Function
Sub GiveItem(Index, Number, Durability)
Dim Slot
Slot = 1
Index = Int(Index)
Number = Int(Number)
Durability = Int(Durability)
Do While Slot < 25
If GetPlayerInvItemNum(Index, Slot) = 0 Then
Call SetPlayerInvItemNum(Index, Slot, Number)
Call SetPlayerInvItemDur(Index, Slot, Durability)
Call SendInventoryUpdate(Index, Slot)
Exit Sub
End If
Slot = Slot + 1
Loop
End Sub
Sub GiveCurrency(Index, Number, Amount)
Dim Slot
Dim CurrentAmount
Slot = 1
Index = Int(Index)
Number = Int(Number)
Amount = Int(Amount)
Do While Slot < 25
If GetPlayerInvItemNum(Index, Slot) = Number Then
CurrentAmount = GetPlayerInvItemValue(Index, Slot)
Call SetPlayerInvItemValue(Index, Slot, CurrentAmount + Amount)
Call SendInventoryUpdate(Index, Slot)
Exit Sub
End If
Slot = Slot + 1
Loop
Slot = 1
Do While Slot < 25
If GetPlayerInvItemNum(Index, Slot) = 0 Then
Call SetPlayerInvItemNum(Index, Slot, Number)
Call SetPlayerInvItemValue(Index, Slot, Amount)
Call SendInventoryUpdate(Index, Slot)
Exit Sub
End If
Slot = Slot + 1
Loop
End Sub
Function CanTake(Index, Number, Amount)
Dim Slot
Slot = 1
Index = Int(Index)
Number = Int(Number)
Amount = Int(Amount)
Do While Slot < 25
If GetPlayerInvItemNum(Index, Slot) = Number Then
If GetPlayerInvItemValue(Index, Slot) >= Amount Then
CanTake = True
Exit Function
End If
End If
Slot = Slot + 1
Loop
CanTake = False
End Function
Sub TakeItem(Index, Number, Amount)
Dim Slot
Dim CurrentAmount
Index = Int(Index)
Number = Int(Number)
Amount = Int(Amount)
Slot = 1
Do While Slot < 25
If GetPlayerInvItemNum(Index, Slot) = Number Then
If GetPlayerInvItemValue(Index, Slot) >= Amount Then
CurrentAmount = GetPlayerInvItemValue(Index, Slot)
If CurrentAmount <= Amount Then
Call SetPlayerInvItemNum(Index, Slot, 0)
Call SetPlayerInvItemValue(Index, Slot, 0)
Call SetPlayerInvItemDur(Index, Slot, 0)
Call SendInventoryUpdate(Index, Slot)
Else
Call SetPlayerInvItemValue(Index, Slot, CurrentAmount - Amount)
Call SendInventoryUpdate(Index, Slot)
End If
Exit Sub
End If
End If
Slot = Slot + 1
Loop
End Sub
' Reputation System
' Made by Admiral Refuge
' Give credit plox
Sub RaiseRep(Index)
If GetVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation") = "" Then
Call PutVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation", 1)
Exit Sub
End If
Dim x
x = Int(GetVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation"))
Call PutVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation", x+1)
End Sub
Sub LowerRep(Index)
If GetVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation") = "" Then
Call PutVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation", "-1")
Exit Sub
End If
Dim x
x = Int(GetVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation"))
Call PutVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation", x-1)
End Sub
Function GetRep(Index)
Dim Rep
Dim ScaleStr(9)
Dim ScaleNum(9)
Rep = Int(GetVar("Reputation.ini", "" & GetPlayerName(Index) & "", "Reputation"))
For i = 0 To 8
ScaleStr(i) = GetVar("Reputation.ini", "SCALE" & "", i & "")
Next
For i = 0 To 8
ScaleNum(i) = Int(GetVar("Reputation.ini", "SCALENUMBER", i & ""))
Next
For i = 0 To 3
If Rep <= ScaleNum(i) Then
GetRep = ScaleStr(i)
Exit Function
End If
Next
For i = 4 To 7
If Rep >= ScaleNum(i) And Rep < ScaleNum(i+1) Then
GetRep = ScaleStr(i)
Exit Function
End If
Next
If Rep > ScaleNum(8) Then
GetRep = ScaleStr(8)
Exit Function
End If
End Function
' Leave this sub at the bottom to test the entire script file.
Sub TestMain(Index)
Call PlayerMsg(Index, "Scripts are working properly.", BRIGHTGREEN)
End Sub
``` -
I have used it in a school, we used LAN and had them connect to the internal IP, didnt matter what port, just use the IP on the top of the server.
-
If stackable is on, you will need to have them all in one pile, otherwise, I have no idea what is wrong.
-
As far as I know, its not really a command, but, thats just from personal testing… Not sure on the whole story.
-
```
If GetPlayerSPEED(Index) > 1999 Then
Call SetSpeed(Index, Walk, 6)
Call SetSpeed(Index, Run, 16)
Exit Sub
End If
If GetPlayerSpeed(Index) > 1499 Then
Call SetSpeed(Index, Run, 12)
Call SetSpeed(Index, Walk, 5)
Exit Sub
End If
If GetPlayerSpeed(Index) > 999 Then
Call SetSpeed(Index, Run, 10)
Exit Sub
End If
If GetPlayerSpeed(Index) > 499 Then
Call SetSpeed(Index, Run, 9)
Exit Sub
End If
```
You forgot the **Then** on most Ifs.
EDIT: Also, put the Exit Subs INSIDE the Ifs, or it will exit after checking the top one. -
66.27.107.138
-
Dawn is a free to play MORPG, based in the world, Bellus Adluvio. We encourage our players to explore the world, and play with friends.
Website:
http://www.liquidgamesstudios.com
Beta Download:
http://www.liquidgamesstudios.com/downloads.html
Screenies:
![](http://www.liquidgamesstudios.com/images/insidecave1.jpg)
![](http://www.liquidgamesstudios.com/images/insidecave2.jpg)
![](http://www.liquidgamesstudios.com/images/humbolton.jpg)
![](http://www.liquidgamesstudios.com/images/humbolton_bank.jpg)
![](http://www.liquidgamesstudios.com/images/middleton.jpg)
![](http://www.liquidgamesstudios.com/images/screen1.jpg)
Classes:
Fighter- Typical Tank-Type class specializing in melee weapons.
Mage- Specializing in magic and healing
Marksman- Great with long range weapons.
Features:
Not Started
Working On
Done
Custom Crafting System
Quest System
Gathering System
Trading
Banking
Heal Spells
Mage Staves
Classes
Boat System
Weapons
Armor
Maps
NPCs
Guild Cities
City Seiges -
Got it workin now, looks all good.
EDIT, VERY Jittery in-game… bouncing all over the place, but only while running, also still can't deposit stackables... -
I seem to be getting the eror, Cannont Read from Data.ini or Stats.ini…
Not sure why.... -
Dude, THANKS!
-
Sorry dude, quotes make it an easy read for me, next time ill post in code… What sort of de-bugger do you have, and where can I find it?
Also, thanks for the help, I am a retard! -
I forgot to mention, yes I tested it, and no it doesnt work, so I have deducted tat the problem is the sub, however after I have had my fine share of debugging, I could not find the problem.
-
Well, I looked into it and I cant seem to find a problem… could you try and find something?
> '********************************
> Sub Craft(index, Skill, Item, Tier, Matone, Valone, Mattwo, Valtwo, Matthree, Valthree, Matfour, Valfour, Matfive, Valfive, Matsix, Valsix, Matseven, Valseven)
> '********************************
> Dim matnum
> Dim slot
> Dim has
> Dim need
> Dim mathas
> Dim success
> Dim level
> Dim times
> Dim tier
>
> Call PlayerMsg(Index, "Here we go!", Black)
> If skill = 1 Then
> level = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","weaponsmith","level")
> times = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","weaponsmith","times")
> ElseIf skill = 2 Then
> level = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","armorsmith","level")
> times = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","armorsmith","times")
> ElseIf skill = 3 Then
> level = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","cooking","level")
> times = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","cooking","times")
> ElseIf skill = 4 Then
> level = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","alchemy","level")
> times = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","alchemy","times")
> ElseIf skill = 5 Then
> level = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","bowery","level")
> times = GetVar("scripts\charextras\" & GetPlayerName(index) & ".ini","bowery","times")
> End If
> success = Rand(100,1)
>
> matnum = 0
> mathas = 0
>
> If Matone = 0 Then
> Else
> matnum = matnum + 1
> End If
> If Mattwo = 0 Then
> Else
> matnum = matnum + 1
> End If
> If Matthree = 0 Then
> Else
> matnum = matnum + 1
> End If
> If Matfour = 0 Then
> Else
> matnum = matnum + 1
> End If
> If Matfive = 0 Then
> Else
> matnum = matnum + 1
> End If
> If Matsix = 0 Then
> Else
> matnum = matnum + 1
> End If
> If Matseven = 0 Then
> Else
> matnum = matnum + 1
> End If
> If matnum >= 1 Then
> slot=1
> has = 0
> need = 1
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=Int(Matone) Then
> If Int(getplayerinvitemvalue(index,slot))>=Int(Valone) Then
> slot=25
> has = 1
> End If
> End If
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
> Exit Sub
> Else
> mathas = mathas + 1
>
> End If
> End If
>
> If matnum >= 2 Then
> slot=1
> has = 0
> need = 1
>
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=Int(Mattwo) Then
> If Int(getplayerinvitemvalue(index,slot))>=Int(Valtwo) Then
> slot=25
> has = 1
> End If
> End If
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
> Exit Sub
> Else
> mathas = mathas + 1
>
> End If
> End If
>
> If matnum >= 3 Then
> slot=1
> has = 0
> need = 1
>
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=Int(Matthree) Then
> If Int(getplayerinvitemvalue(index,slot))>=Int(Valthree) Then
> slot=25
> has = 1
> End If
> End If
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
> Exit Sub
> Else
> mathas = mathas + 1
>
> End If
> End If
>
> If matnum >= 4 Then
> slot=1
> has = 0
> need = 1
>
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=Int(Matfour) Then
> If Int(getplayerinvitemvalue(index,slot))>=Int(Valfour) Then
> slot=25
> has = 1
> End If
> End If
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
> Exit Sub
> Else
> mathas = mathas + 1
>
>
> End If
> End If
>
> If matnum >= 5 Then
> slot=1
> has = 0
> need = 1
>
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=Int(Matfive) Then
> If Int(getplayerinvitemvalue(index,slot))>=Int(Valfive) Then
> slot=25
> has = 1
> End If
> End If
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
> Exit Sub
> Else
> mathas = mathas + 1
>
> End If
> End If
>
> If matnum >= 6 Then
> slot=1
> has = 0
> need = 1
>
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=Int(Matsix) Then
> If Int(getplayerinvitemvalue(index,slot))>=Int(Valsix) Then
> slot=25
> has = 1
> End If
> End If
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
> Exit Sub
> Else
> mathas = mathas + 1
>
> End If
> End If
>
> If matnum >= 7 Then
> slot=1
> has = 0
> need = 1
>
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=Int(Matseven) Then
> If Int(getplayerinvitemvalue(index,slot))>=Int(Valseven) Then
> slot=25
> has = 1
> End If
> End If
> slot=slot+1
> Loop
> If Int(has) <> Int(need) Then
> Call PlayerMsg(Index, "You do not have the proper items or proper amount of items.", RED)
> Exit Sub
> Else
> mathas = mathas + 1
> End If
> End If
>
> If mathas >= matneed Then
> If mathas >= 1 Then
> Call quest_Take_Item(index, Matone, Valone)
> End If
> If mathas >= 2 Then
> Call quest_Take_Item(index, Mattwo, Valtwo)
> End If
> If mathas >= 3 Then
> Call quest_Take_Item(index, Matthree, Valthree)
> End If
> If mathas >= 4 Then
> Call quest_Take_Item(index, Matfour, Valfour)
> End If
> If mathas >= 5 Then
> Call quest_Take_Item(index, Matfive, Valfive)
> End If
> If mathas >= 6 Then
> Call quest_Take_Item(index, Matsix, Valsix)
> End If
> If mathas >= 7 Then
> Call quest_Take_Item(index, Matseven, Valseven)
> End If
>
> If success <= Int(level)+79 Then
>
> slot=1
>
> Do While slot < 25
> If Int(getplayerinvitemnum(index,slot))=0 Then
> Call SetPlayerInvItemNum(Index, slot, Item)
> Call SetPlayerInvItemValue(Index, slot, 1)
> Call SendInventoryUpdate( Index, slot)
> slot=25
> End If
> slot=slot+1
> Loop
> Call PlayerMsg(Index, "You successfully created 1 " & GetItemName(Item) & "", GREEN)
>
> If skill = 1 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","weaponsmith","times",Int(times) + 1)
>
> times = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","weaponsmith","times")
>
> If Tier >= level Then
> If level < 20 Then
> If Int(times) >= Int(level) * 50 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","weaponsmith","level",Int( level) + 1)
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","weaponsmith","times",0)
> Call PlayerMsg(index, "You gained a level in Weapon Smithing and are now level, " & Int(level) + 1 & "", GREEN)
> End If
> End If
> End If
> ElseIf skill = 2 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","armorsmith","times",Int(times) + 1)
>
> times = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","armorsmith","times")
>
> If Tier >= level Then
> If level < 20 Then
> If Int(times) >= Int(level) * 50 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","armorsmith","level",Int( level) + 1)
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","armorsmith","times",0)
> Call PlayerMsg(index, "You gained a level in Armor Smithing and are now level, " & Int(level) + 1 & "", GREEN)
> End If
> End If
> End If
> ElseIf skill = 3 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","cooking","times",Int(times) + 1)
>
> times = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","cooking","times")
>
> If Tier >= level Then
> If level < 20 Then
> If Int(times) >= Int(level) * 50 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","cooking","level",Int( level) + 1)
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","cooking","times",0)
> Call PlayerMsg(index, "You gained a level in Cooking and are now level, " & Int(level) + 1 & "", GREEN)
> End If
> End If
> End If
> ElseIf skill = 4 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","alchemy","times",Int(times) + 1)
>
> times = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","alchemy","times")
>
> If Tier >= level Then
> If level < 20 Then
> If Int(times) >= Int(level) * 50 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","alchemy","level",Int( level) + 1)
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","alchemy","times",0)
> Call PlayerMsg(index, "You gained a level in Alchemy and are now level, " & Int(level) + 1 & "", GREEN)
> End If
> End If
> End If
> ElseIf skill = 5 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","bowery","times",Int(times) + 1)
>
> times = Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini","bowery","times")
>
> If Tier >= level Then
> If level < 20 Then
> If Int(times) >= Int(level) * 50 Then
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","bowery","level",Int( level) + 1)
> Call Putvar("scripts\charextras\" & GetPlayerName(index) & ".ini","bowery","times",0)
> Call PlayerMsg(index, "You gained a level in Bowery and are now level, " & Int(level) + 1 & "", GREEN)
> End If
> End If
> End If
> End If
>
> Else
> Call PlayerMsg(Index, "You failed to craft 1 " & GetItemName(Item) & "", RED)
>
> End If
>
> End If
> End Sub -
Of course I do…
-
Yes, I am… I keep having problems with perfect codes...
-
Still not working… Not sure what the problem is...
-
I am making a crafting system and I ended up with a little bug… I have no idea what is wrong with this statement, however, I know it is the If statement... help?
> If Clicked_Index = 3 Then
> Call Craft(Index, 3, 1, 8, 2, 45, 1, 44, 3, 46, 1, 0,0,0,0,0,0)
> Call PlayerMsg(Index, "Got here " , RED)
> ElseIf Clicked_Index = 5 Then
> Call Craft(Index, 40, 2, 8, 3, 45, 10, 44, 5, 47, 1, 0,0,0,0,0,0)
> ElseIf Clicked_Index = 6 Then
> Call Craft(Index, 42, 2, 8, 3, 45, 15, 44, 2, 46, 1, 0,0,0,0,0,0)
> ElseIf Clicked_Index = 7 Then
> Call Craft(Index, 43, 2, 8, 5, 45, 10, 0, 0, 0, 0, 0,0,0,0,0,0)
> ElseIf Clicked_Index = 9 Then
> Call Craft(Index, 76, 3, 8, 5, 47, 10, 44, 10, 48, 3, 0,0,0,0,0,0)
> ElseIf Clicked_Index = 10 Then
> Call Craft(Index, 77, 3, 8, 3, 47, 15, 44, 5, 48, 2, 0,0,0,0,0,0)
> ElseIf Clicked_Index = 11 Then
> Call Craft(Index, 78, 3, 8, 10, 47, 15, 48, 3, 0, 0, 0,0,0,0,0,0)
> End If -
@Damian666:
> pfff. go do it yourself then man…
>
> is it just me, or ar members nagging more these days?
>
> he is doing this in his free time for you guys, respect that...
>
> Damian666
Ill gladly do it if you lend me a compiler… These aren't difficult fixes, I just cant compile the code... -
I just finished installing this and have been going around testing things, biggest problem is that for trade, everytime I trade with another player, one of them crashes.
Normally RTE 9.
Also, Why call the banks "fixed" when you cant deposit stackables?
So, This is just a buggier version wit a few fixes… -
Alright, I have been doing some things to try and make this work, but it just seems like its going to be stubborn… SO, I might have to re-think the way I use it, but thanks for the help. There is honestly nothing wrong with the script, just one of those annoying eclipse bugs I guess...
-
Still no worky, I have had problems with this before, never knew why…
-
Those are for picture clicks and input boxes.
-
Ok, this is stupid… When I have it check the menu title it magically doesnt work, but when it skips that, it magically orks, however I cant differ with all the diff menus...
Help?
Please?
> '********************************
> Sub MenuScripts(Index, Clicked_Index, Menu_Type)
> '********************************
> Dim MenuTitle
> Dim FieldMessage
>
> MenuTitle = getplayermenuclicktitle(Index)
> FieldMessage = getplayermenuclickmsg(Index)
>
> Select Case Menu_Type
> Case 1
>
>
> Case 2
>
> Case 3
> If MenuTitle = "WeaponSmithing" Then
> If Clicked_Index = 1 Then
> Call Craft(Index, 3, 8, 2, 44, 1, 45, 3, 46, 1, 0,0,0,0,0,0)
> End If
> Else If MenuTitle = "ArmorSmithing" Then
> If Clicked_Index = 1 Then
> Call Craft(Index, 3, 8, 2, 44, 1, 45, 3, 46, 1, 0,0,0,0,0,0)
> End If
> Else If MenuTitle = "Cooking" Then
> If Clicked_Index = 1 Then
> Call Craft(Index, 3, 8, 2, 44, 1, 45, 3, 46, 1, 0,0,0,0,0,0)
> End If
> Else If MenuTitle = "Alchemy" Then
> If Clicked_Index = 1 Then
> Call Craft(Index, 3, 8, 2, 44, 1, 45, 3, 46, 1, 0,0,0,0,0,0)
> End If
> Else If MenuTitle = "Bowery" Then
> If Clicked_Index = 1 Then
> Call Craft(Index, 3, 8, 2, 44, 1, 45, 3, 46, 1, 0,0,0,0,0,0)
> End If
> End If
> End Select
> End Sub -
Wow, didn't know that, might be good for it to be put in later… Anyhow, thanks for the help, works like a charm now!
Quick question
in Programming Questions
Posted
Say if you have sub Blah;
```
Sub Blah(Index, Blah)
If Blah <> 1 Then
Call PlayerMsg(Index, "Blah!", Black)
End If
```
You may call it in say a scripted tile case;
```
Case 0
Call Blah(Index, 1)
Exit Sub
```
Works just like that!