Akselj Posted November 1, 2008 Author Share Posted November 1, 2008 I got a very big problem: when I need to reinstall a script because it is not working properly, it stops working.May the reason be that I am using Windows Vista?Any help appreciated.Thanks,AkselJ Link to comment Share on other sites More sharing options...
Godlord Posted November 1, 2008 Share Posted November 1, 2008 @Akselj:> I got a very big problem: when I need to reinstall a script because it is not working properly, it stops working.> May the reason be that I am using Windows Vista?> Any help appreciated.> > Thanks,> AkselJAre you sure scripting is enabled on your server?Regards, Goddianicus. Link to comment Share on other sites More sharing options...
Akselj Posted November 1, 2008 Author Share Posted November 1, 2008 Yup, I never changed those settings… And to be 100% sure, I just tested it. All I do is find an unchanged Main.txt and put in the same scripts as in the old one.BTW Goddie, I think it is the same problem as with the teleport spell, that problem occured the same way. Link to comment Share on other sites More sharing options...
Mellowz Posted November 2, 2008 Share Posted November 2, 2008 Are you using 2.7?If you copied your 2.6 scripts over to 2.7, some commands have been renamed or deleted. Link to comment Share on other sites More sharing options...
AdrianC Posted November 2, 2008 Share Posted November 2, 2008 If its from 2.7 to 2.7 you probably messed up copying the scripts.Just copy the whole main.txtMaybe your scripts require .ini files which were created by hand initially? Link to comment Share on other sites More sharing options...
Akselj Posted November 2, 2008 Author Share Posted November 2, 2008 @Scribbles:> Are you using 2.7?> > If you copied your 2.6 scripts over to 2.7, some commands have been renamed or deleted.Nope, it's from EE 2.7 to 2.7 Link to comment Share on other sites More sharing options...
Akselj Posted November 2, 2008 Author Share Posted November 2, 2008 @AdrianC:> If its from 2.7 to 2.7 you probably messed up copying the scripts.> > Just copy the whole main.txt> > Maybe your scripts require .ini files which were created by hand initially?Well… I don't think that's the problem either... Because I used Baron's Skill Superscript, and I messed it up trying to use OnClick... So, I found an fresh Main.txt and re-installed the whole script, using the one that's in the topic. And, as all of Baron's script that require INI's, it creates them, and I did not delete the one's I used for skills i was using in the game at that time. Link to comment Share on other sites More sharing options...
Akselj Posted November 2, 2008 Author Share Posted November 2, 2008 Ooooh… I just made Baron's skill script work... But there are still some other scripts that dosen't work... Link to comment Share on other sites More sharing options...
Dark Crusade Posted November 2, 2008 Share Posted November 2, 2008 Akselj, please do not triple post. If you need to add something, edit your previous post. Link to comment Share on other sites More sharing options...
Akselj Posted November 2, 2008 Author Share Posted November 2, 2008 Sorry… But at the two first I was just answering the other post, I didn't think that counted? Link to comment Share on other sites More sharing options...
Dark Crusade Posted November 2, 2008 Share Posted November 2, 2008 @Akselj:> Sorry… But at the two first I was just answering the other post, I didn't think that counted?You could have answered both post in the same post, it wasn't completely necessary to make 2 separate posts, and then a 3rd to follow. But its ok, just try and not do it all the time. Link to comment Share on other sites More sharing options...
Akselj Posted November 5, 2008 Author Share Posted November 5, 2008 Is there nobody that can help me with this? Link to comment Share on other sites More sharing options...
Godlord Posted November 6, 2008 Share Posted November 6, 2008 To be honest we could, but not everybody has physic powers. I think it would be best to post your main.txt.Regards, The Nameless One. Link to comment Share on other sites More sharing options...
Akselj Posted November 6, 2008 Author Share Posted November 6, 2008 Okay…Here you go:```' Eclipse Evolution 2.7 Scripting File' Global VariablesPublic GameNamePublic MAX_MAPSPublic MOTD' Color ConstantsPublic Const BLACK = 0Public Const BLUE = 1Public Const GREEN = 2Public Const CYAN = 3Public Const RED = 4Public Const MAGENTA = 5Public Const BROWN = 6Public Const GREY = 7Public Const DARKGREY = 8Public Const BRIGHTBLUE = 9Public Const BRIGHTGREEN = 10Public Const BRIGHTCYAN = 11Public Const BRIGHTRED = 12Public Const PINK = 13Public Const YELLOW = 14Public Const WHITE = 15' Admin ConstantsPublic Const ADMIN_MONITER = 1Public Const ADMIN_MAPPER = 2Public Const ADMIN_DEVELOPER = 3Public Const ADMIN_CREATOR = 4' Executes when the server initially loads.Sub OnServerLoad() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes when the scripts are reloaded.Sub OnScriptReload() GameName = GetVar("Data.ini", "CONFIG", "GameName") MAX_MAPS = GetVar("Data.ini", "MAX", "MAX_MAPS") MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes the MOTD is changed by the client.Sub ChangeMOTD() MOTD = GetVar("MOTD.ini", "MOTD", "Msg")End Sub' Executes when a new character is created.Sub OnNewChar(Index, CharNum)End Sub' Executes every second, based on the server time.Sub TimedEvent(Hours, Minutes, Seconds) If Minutes = 0 Then If Seconds = 0 Then Call AdminMsg("Don't forget to vote for Eclipse.", YELLOW) End If End IfEnd Sub' Executes when a player presses the CONTROL key.Sub OnAttack(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End IfEnd SubSub OnArrowHit(Index, Damage) Dim Target If Int(Damage) > 0 Then If Int(GetPlayerTarget(Index)) > 0 Then Target = GetPlayerTarget(Index) Call DamagePlayer(Index, Target, Damage) Else Target = GetPlayerTargetNPC(Index) Call DamageNPC(Index, Target, Damage) End If End IfEnd SubSub PlayerHit(Index, NPCNum, Damage) If Damage > 0 then Call NPCAttack(NPCNum, Index, Damage) End IfEnd Sub' Executes when a hotkey is pressed client-side.Sub HotScript(Index, KeyID) Select Case KeyID ' Executes when any player presses the PageUp key. Case 1 ' Executes when any player presses the Delete key. Case 2 ' Executes when players press the End key. Case 3 ' Executes when players press the PageDown key. Case 4 End SelectEnd Sub' Executes when something on a custom menu is clicked.Sub MenuScripts(Index, Clicked_Index, Menu_Type) Dim MenuTitle Dim FieldMessage MenuTitle = getplayermenuclicktitle(Index) FieldMessage = getplayermenuclickmsg(Index) Select Case Menu_Type Case 1 Call PlayerMsg(Index, "Clicked picture number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) Case 2 Call PlayerMsg(Index, "Clicked field number " & Clicked_Index & " on the menu named " & MenuTitle & ". The field text was " & FieldMessage, YELLOW) Case 3 Call PlayerMsg(Index, "Clicked label number " & Clicked_Index & " on the menu named " & MenuTitle, YELLOW) End SelectEnd Sub' Executes when a player logs into the game.Sub JoinGame(Index)If GetVar("var.ini", GetPlayerName(index), "startup") = "" Thenweapon = 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 ThenCall Give_Item(index, weapon, wepdur)End IfIf armor <> 0 ThenCall Give_Item(index, armor, armdur)End IfIf shield <> 0 ThenCall Give_Item(index, shield, shldur)End IfIf helmet <> 0 ThenCall Give_Item(index, helmet, hlmdur)End IfCall PutVar("var.ini", GetPlayerName(index), "startup", "yes")End If If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has joined " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has joined " & GameName & "!", YELLOW) End If Call PlayerMsg(Index, "Welcome to " & GameName & "!", WHITE) If LenB(MOTD) <> 0 Then Call PlayerMsg(Index, "MOTD: " & MOTD, BRIGHTCYAN) End If Call SendWhosOnline(Index)End Sub' Executes when a player logs out of the game.Sub LeftGame(Index) If GetPlayerAccess(Index) = 0 Then Call GlobalMsg(GetPlayerName(Index) & " has left " & GameName & "!", GREY) Else Call GlobalMsg("Administrator " & GetPlayerName(Index) & " has left " & GameName & "!", YELLOW) End IfEnd Sub' Executes when a players experience exceeds the next level requirement.Sub PlayerLevelUp(Index) Dim TotalExp Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index) TotalExp = GetPlayerExp(Index) - GetPlayerNextLevel(Index) Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1) Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + 5) Call SetPlayerExp(Index, TotalExp) Loop Call BattleMsg(Index, "You have " & GetPlayerPOINTS(Index) & " unused 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 > 2500 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 > 2500 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 > 2500 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 > 2500 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 Baron_Uber_skills(index)'<><><><><>Case 1 Call Baron_Stam_regain(index) Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executes when a player clicks on an OnClick tile.Sub OnClick(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Out-dated: Executes when a player chooses yes or no on a player prompt.Sub PlayerPrompt(Index, Prompt, Value) If Prompt = 6 Then Select Case Value Case 0 Call GlobalMsg("Hi This is a Yes answer!", CYAN) Case 1 Call GlobalMsg("This is case 1?", CYAN) End Select Else Select Case Value Case 0 Call GlobalMsg("Hi This is a No answer!", RED) Case 1 Call GlobalMsg("This is no case 1?", RED) End Select End IfEnd Sub' Out-dated: Executes query box responses.Sub QueryBox(Index, Prompt) Value = GetVar("responses.ini", "Responses", CStr(Index))End Sub' Executes every time a player drops an item.Sub OnItemDrop(Index, Map, ItemNum, ItemVal, ItemDur, ItemIndex, InvSlot)End Sub' Executes each time a player changes map.Sub OnMapLoad(Index, OldMap, NewMap)End Sub' Executes whenever an NPC is killed.' Note: Death occurs as normal externally to this script.Sub OnNPCDeath(Index, Map, NPCNum, NPCIndex) Call BattleMsg(Index, "You killed a " & getnpcname(NPCNum) & ".", BRIGHTRED, 0)End Sub' Executes when a player is killed by another.' Note: Death occurs as normal externally to this script.Sub OnPVPDeath(Attacker, Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been killed by " & GetPlayerName(Attacker), BRIGHTRED)End Sub' Executes when a player dies in an arena by another player.Sub OnArenaDeath(Attacker, Victim) Dim Map Dim X Dim Y Dim Data1 Dim Data2 Dim Data3 Map = GetPlayerMap(Victim) X = GetPlayerX(Victim) Y = GetPlayerY(Victim) Call GlobalMsg(GetPlayerName(Victim) & " has been defeated in the arena by " & GetPlayerName(Attacker), BRIGHTRED) Call SetPlayerHP(Victim, GetPlayerMaXHP(Victim)) Call SetPlayerMP(Victim, GetPlayerMaXMP(Victim)) Call sendHp(Victim) Call sendMP(Victim) Data1 = GetTileData1(Map, X, Y) Data2 = GetTileData2(Map, X, Y) Data3 = GetTileData3(Map, X, Y) Call PlayerWarp(Victim, Data1, Data2, Data3)End Sub' Executes whenever a player casts a scripted spell.Sub ScriptedSpell(Index, Script) Select Case Script Case 0 Call PlayerWarp(index, 1, 0, 0) Call PlayerMsg(index, "You teleported home!", 15) End Select Case 1 Call PlayerWarp(index, 10, 15, 15) Call PlayerMsg(index, "You teleported to the castle!", 15) End Select Case 2 Call PlayerWarp(index, M, X, Y) Call PlayerMsg(index, "You teleported to the shops!", 15) End Select Case 3 Call PlayerWarp(index, 17, 15, 15) Call PlayerMsg(index, "You teleported to Chinatown!", 15) End Select Case 4 Call PlayerWarp(index, 20, 15, 15) Call PlayerMsg(index, "You teleported to Mr. Wong!", 15) End Select Case 5 Call PlayerWarp(index, 15, 15, 15) Call PlayerMsg(index, "You teleported to the desert!", 15) End SelectEnd Sub Case Else Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executes whenever a scripted NPC does an action.Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Executed whenever a slash command is sent to the server.Sub Commands(Index) 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 End If Exit Sub End Select Call PlayerMsg(Index, "That is not a valid command.", BRIGHTRED)End Sub' Executes on death, dropping all of the players items.Sub DropItems(Index) ' Remove this to enable. Exit Sub If GetPlayerWeaponSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerWeaponSlot(Index), 0) End If If GetPlayerArmorSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerArmorSlot(Index), 0) End If If GetPlayerHelmetSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerHelmetSlot(Index), 0) End If If GetPlayerShieldSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerShieldSlot(Index), 0) End If If GetPlayerLegsSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerLegsSlot(Index), 0) End If If GetPlayerRingSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerRingSlot(Index), 0) End If If GetPlayerNecklaceSlot(Index) > 0 Then Call PlayerMapDropItem(Index, GetPlayerNecklaceSlot(Index), 0) End IfEnd 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 IfEnd Sub' Executes whenever a scripted item is used or double clicked.Sub ScriptedItem(Index, Script) Select Case Script Case 0x = Rand(4,1)If x = 1 Then Call SetPlayerMP(index, int(GetPlayerMP(index)-int(int(GetPlayerMaxMP(index)/100)*5))) Call PlayerMsg(index, "You drink the beer and feel your heart sink...", 7) Call TakeItem(Index, 65)End IfIf x = 2 Then Call SetPlayerMP(index, int(GetPlayerMP(index)+int(int(GetPlayerMaxMP(index)/100)*5))) Call PlayerMsg(index, "You drink the beer and feel your spirits lifting!", 7) Call TakeItem(Index, 65)End IfIf x = 3 Then Call SetPlayerHP(index, int(GetPlayerHP(index)-int(int(GetPlayerMaxHP(index)/100)*5))) Call PlayerMsg(index, "You drink the beer and feel slightly sick...", 7) Call TakeItem(Index, 65)End IfIf x = 4 Then Call SetPlayerHP(index, int(GetPlayerHP(index)+int(int(GetPlayerMaxHP(index)/100)*5))) Call PlayerMsg(index, "You drink the beer and feel a bit better!", 7) Call TakeItem(Index, 65)End IfIf GetPlayerHP(index) <= 0 Then Call OnDeath(index) Call PlayerMsg(index, "You wake up not having a clue what happened... You are hopeless drunk!", 7) Call TakeItem(Index, 65)End IfIf GetPlayerMP(index) <= 0 Then Call PlayerMsg(index, "The beer would kill more brain cells, but there aren't any left to kill... You are hopeless drunk!", 7) Call TakeItem(Index, 65)End If Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub' Map AttributesSub SetBlank(Map, X, Y) Call SetAttribute(Map, X, Y, 0, 0, 0, 0, "", "", "")End SubSub SetBlock(Map, X, Y) Call SetAttribute(Map, X, Y, 1, 0, 0, 0, "", "", "")End SubSub SetWarp(Map, X, Y, WarpMap, WarpX, WarpY) Call SetAttribute(Map, X, Y, 2, WarpMap, WarpX, WarpY, "", "", "")End SubSub SetItem(Map, X, Y, ItemID, ItemValue) Call SetAttribute(Map, X, Y, 3, ItemID, ItemValue, 0, "", "", "")End SubSub SetNPCAvoid(Map, X, Y) Call SetAttribute(Map, X, Y, 4, 0, 0, 0, "", "", "")End SubSub SetKeY(Map, X, Y, KeyID, KeyTake) Call SetAttribute(Map, X, Y, 5, KeyID, KeyTake, 0, "", "", "")End SubSub SetKeYOpen(Map, X, Y, KeyX, KeyY, Message) Call SetAttribute(Map, X, Y, 6, KeyX, KeyY, 0, Message, "", "")End SubSub SetHeal(Map, X, Y) Call SetAttribute(Map, X, Y, 7, 0, 0, 0, "", "", "")End SubSub SetKill(Map, X, Y) Call SetAttribute(Map, X, Y, 8, 0, 0, 0, "", "", "")End SubSub SetShop(Map, X, Y, ShopID) Call SetAttribute(Map, X, Y, 9, ShopID, 0, 0, "", "", "")End SubSub SetClassBlock(Map, X, Y, Allow1, Allow2, Allow3) Call SetAttribute(Map, X, Y, 10, Allow, Allow2, Allow3, "", "", "")End SubSub SetArena(Map, X, Y, MapID, NewX, NewY) Call SetAttribute(Map, X, Y, 11, MapID, NewX, NewY, "", "", "")End SubSub SetSound(Map, X, Y, FileName) Call SetAttribute(Map, X, Y, 12, 0, 0, 0, FileName, "", "")End SubSub SetSpriteChange(Map, X, Y, SpriteID, ItemID, Cost) Call SetAttribute(Map, X, Y, 13, SpriteID, ItemID, Cost, "", "", "")End SubSub SetSign(Map, X, Y, Line1, Line2, Line3) Call SetAttribute(Map, X, Y, 14, 0, 0, 0, Line1, Line2, Line3)End SubSub SetDoor(Map, X, Y) Call SetAttribute(Map, X, Y, 15, 0, 0, 0, "", "", "")End SubSub SetNotice(Map, X, Y, Title, Text, FileName) Call SetAttribute(Map, X, Y, 16, 0, 0, 0, Title, Text, FileName)End SubSub SetScripted(Map, X, Y, Script) Call SetAttribute(Map, X, Y, 18, Script, 0, 0, "", "", "")End SubSub SetBank(Map, X, Y) Call SetAttribute(Map, X, Y, 23, 0, 0, 0, "", "", "")End Sub' Tests scripts up to the location of Sub TestMain(Index).' Leave this sub at the bottom to test the entire script file.Sub TestMain(Index) Call PlayerMsg(Index, "Scripts are working properly.", BRIGHTGREEN)End Sub'********************************Function F_Freeslots(index) '********************************Dim slotDim countslot=1count=0 Do While slot < 25 If getplayerinvitemnum(index, slot) = 0 Then count = Int(count) + 1 End If slot=Int(slot) + 1 LoopF_Freeslots=Int(count)End Function'********************************Sub Give_Item(index, number, durability)'********************************Dim slotslot = 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 LoopEnd Sub'********************************Sub Give_Currency(index, number, quantity)'********************************Dim slotDim initialDim finalDim givenslot=1given=0 Do While slot < 25 If Getplayerinvitemnum(index,Int(slot))=Int(number) Then initial = Getplayerinvitemvalue( index, Int( slot ) ) final = Int( initial ) + Int( quantity ) Call setplayerinvitemvalue( index, Int( slot ), Int( final ) ) Call SendInventoryUpdate(index, Int(slot) ) slot = 25 given = 1 End If slot = slot + 1 Loop If given=1 Then slot=25 Else slot=1 End If Do While slot < 25 If Getplayerinvitemnum(index,Int(slot)) = 0 Then Call SetPlayerInvItemNum(index, Int( slot ), Int( number ) ) Call SetPlayerInvItemValue(index, Int( slot ), Int( quantity ) ) Call SetPlayerInvItemDur(index, Int( slot ), 0 ) Call SendInventoryUpdate(index, Int(slot) ) slot = 25 End If slot = slot + 1 LoopEnd Sub'********************************Function F_Check_Take(index, number, value)'********************************Dim slotslot = 1F_Check_Take =0 Do While slot < 25 If Getplayerinvitemnum( index, Int( slot ) ) = Int( number ) Then If GetPlayerInvItemValue(index, Int( slot ) ) >= Int(value) Then F_Check_Take=1 End If End If slot = slot + 1 LoopEnd Function'********************************Sub Take_Item(index, number, value)'********************************Dim slotDim takenDim initialDim finalslot=1taken=0 Do While Int(slot) < 25 If Int(taken)=0 Then If Getplayerinvitemnum(index,Int(slot)) = Int(number) Then If Int(getplayerinvitemvalue(index, Int(slot))) >= Int(value) Then initial = Int(getplayerinvitemvalue(index, Int(slot) ) ) final = Int(initial) - Int(value) If Int(final) <= 0 Then Call setplayerinvitemnum(index, Int(slot), Int(0) ) Call setplayerinvitemvalue(index, Int(slot), Int(0) ) Call setplayerinvitemdur(index, Int(slot), Int(0) ) Call SendInventoryUpdate(index, Int(slot)) taken=1 Else Call setplayerinvitemvalue(index, Int(slot), Int(final) ) Call SendInventoryUpdate(index, Int(slot) ) taken=1 End If End If End If End If slot = slot + 1 LoopEnd Sub'********************************Sub Baron_Stam_regain(index)'********************************Dim skill_typeDim skill_actionDim stam_totalDim player_lvlskill_type=Trim( GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "SKILL","type") ) If Int(Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type), "has_data") ) < 1 Then Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "Exp", Int(0) ) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "level", Int(0)) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "stamina", Int(10)) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "has_data", Int(1)) Call battlemsg(index, "You should return here if you wish to rest", 14, 1) End Ifplayer_lvl=Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "level")skill_action=Trim(GetVar("scripts\skills\" & skill_type & ".ini", "INDEX","action"))stam_total=5 + Int(player_lvl)Call PutVar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "stamina", Int(stam_total))Call battlemsg(index, "You feel refreshed and ready to " & skill_action & " again.", 14, 1)End Sub'********************************Sub Baron_Uber_skills(index)'********************************'Do not modify this script in any way.'It is provided as is in all goodwill.'There is CONSIDERABLE time spent here.On Error Resume nextDim skill_typeDim skill_numberDim take_totalDim give_totalDim countDim take_countDim take_numDim take_valDim take_msgDim empty_spaceDim take_checkDim needed_itemDim player_weaponDim skill_actionDim currency_checkDim recipe_countDim recipe_totalDim min_lvlDim player_lvlDim player_stamDim recipe_stamDim give_valDim give_numDim give_durDim give_msgDim high_randomiserDim success_chanceDim low_chanceDim high_chanceDim give_expDim new_expDim lvl_expDim next_lvlIf Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "SKILL","has_data")) < 0 ThenCall Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "SKILL","type", "")Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "SKILL","number", 0)Call Putvar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "SKILL","has_data", 1)Call Playermsg(index, "Made skill template for map", 14)Call Playermsg(index, "Credits go to Baron - http://barony.deviantart.com/", 14)End IfRECIPE_COUNT = Int(1)skill_type=Trim( GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "SKILL","type") )recipe_total=Int(GetVar("scripts\skills\" & skill_type & ".ini","INDEX" ,"total_recipes"))'RECIPES ALWAYS HAVE SKILL 1 SELECTED IN MAPEXTRAS AND TOTAL RECIPES IN SKILLS SET TO HIGHEST'NON RECIPES HAVE ANY SKILL SELECTED IN MAPEXTRAS AND TOTAL RECIPES IN SKILLS SET TO 1Do While Int(RECIPE_COUNT) <= Int(recipe_total) If trim(skill_type) <> "" Then skill_number = Int(GetVar("scripts\mapextras\" & GetPlayerMap(index) & ".ini", "SKILL","number")) If Int(recipe_count) > 1 Then skill_number = Int(recipe_count) End If needed_item=Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number),"item_num_needed")) player_weapon=Int( Getplayerinvitemnum(index, Int(getplayerweaponslot(index)) ) ) skill_action=Trim(GetVar("scripts\skills\" & skill_type & ".ini", "INDEX","action")) If Int(needed_item) = Int(player_weapon) Then min_lvl = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number),"min_level")) If Int(Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type), "has_data") ) < 1 Then Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "Exp", Int(0) ) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "level", Int(0)) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "stamina", Int(10)) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "has_data", Int(1)) Call playermsg(index, "You attempt to " & skill_action & " for the first time!", 14) End If player_lvl = Int(Getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "level")) If Int(min_lvl) <= Int(player_lvl) Then player_stam=Int(getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "stamina")) recipe_stam=Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number),"stam_taken")) If Int(player_stam) >= Int(recipe_stam) Then take_total = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number),"take_total")) give_total = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number),"give_total")) count = Int ( 1 ) take_count = Int ( 0 ) empty_space=F_Freeslots(index) If Int(give_total) <= Int(empty_space) Then Do While count <= Int(take_total) take_num=Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_take_num")) take_val=Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_take_val")) take_check=F_Check_Take(index,take_num,take_val) take_count=take_count + Int(take_check) count=count+1 Loop If Int(take_count) = Int(take_total) Then count = Int ( 1 ) Do While Int(count) <= Int(take_total) take_num=Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_take_num")) take_val=Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_take_val")) take_msg=Trim(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_take_Msg")) Call battlemsg(index, trim(take_msg), 15, 1) Call Take_Item(index, Int(take_num), Int(take_val) ) count=count+1 Loop count = Int ( 1 ) new_exp = 0 Do While Int(count) <= Int(give_total) give_val = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_give_val")) give_msg = Trim(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_give_msg")) success_chance = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_base_chance")) low_chance= Int(player_lvl) - Int(min_lvl) + 1 high_chance = Int(player_lvl) - Int(min_lvl) + Int(success_chance) high_randomiser = Int((high_chance + 1) * Rnd) If Int(high_randomiser) <= Int(low_chance) Then If Int(give_val) > 0 Then give_num = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_give_num")) Call Give_Currency(index, Int(give_num), Int(give_val) ) Call battlemsg(index, Trim(give_msg),10, 1) 'TO HAVE THE SCRIPT AUTO CREATE ALL ITEMS IT CAN ONCE EACH, REMOVE LINE BELOW RECIPE_COUNT= Int(recipe_total) Else give_num = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_give_num")) give_dur = Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_give_dur")) Call Give_Item(index, give_num, give_dur) Call battlemsg(index, Trim(give_msg),10, 1) 'TO HAVE THE SCRIPT AUTO CREATE ALL ITEMS IT CAN ONCE EACH, REMOVE LINE BELOW RECIPE_COUNT= Int(recipe_total) End If give_exp = 0 + Int(GetVar("scripts\skills\" & skill_type & ".ini", Int(skill_number), Int(count) & "_EXP")) new_exp = 0 + Int(getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "exp")) + Int(give_exp) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "exp", Int(new_exp)) End If If new_exp=0 Then new_exp=Int(getvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "exp")) End If count=count+1 Loop next_level = Int(player_lvl) + Int(1) lvl_exp = Int(Getvar("experience.ini", "EXPERIENCE", "Exp" & Int(next_level) ) ) Call battlemsg(index,new_exp & " / " & lvl_exp & " For " & next_level & " " & trim(skill_type), 6, 0) If Int(new_exp) >= Int(lvl_exp) and Int(player_lvl) < 100 Then new_exp= 0 + Int(new_exp) - Int(lvl_exp) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "exp", Int(new_exp)) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "level", Int(next_level)) Call battlemsg(index, "Congratulations, you are now level " & Int(next_level) & " in " & trim(skill_type) & "!", 13, 1) End If player_stam = Int(player_stam) - Int(recipe_stam) Call putvar("scripts\charextras\" & GetPlayerName(index) & ".ini", Trim(Skill_type) , "stamina", Int(player_stam)) If Int(recipe_total) = 1 Then RECIPE_COUNT= Int(recipe_total) End If Else If Int(recipe_count) + 1 > Int(recipe_total) and Int(recipe_total) > Int(1) Then Call battlemsg(index, "You have no components to " & skill_action, 12, 1) End If End If Else Call battlemsg(index, "You need more inventory room to continue " & skill_type & ".", 15, 1) End If Else Call battlemsg(index, "You are too tired to " & skill_action & ".", 12, 1) End If Else Call battlemsg(index, "You get nothing.", 15, 1) End If End If 'This continues off end of item script. Used when empty slot. Elseif errors usually. If Int(needed_item) <> Int(player_weapon) and Int(recipe_count) = 1 Then Call battlemsg(index, "You need to get the right tool/component to " & skill_action & " here.", 15, 1) End If Else 'Not working. Cant figure out why. Is non essential for the script to work. Call Playermsg(index, "You still need to define a skill for this map", 14) End IfRECIPE_COUNT = Int(recipe_count)+1LoopEnd SubSub TakeItem(index, item, value)If value = "all" ThenSLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = item ThenCall SetPlayerInvItemNum(index, SLOT, 0)Call SetPlayerInvItemValue(index, SLOT, 0)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd SubElseSLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = item ThenCall SetPlayerInvItemNum(index, SLOT, 0)Call SetPlayerInvItemValue(index, SLOT, GetPlayerInvItemValue(index, SLOT) - value)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd SubEnd IfSub GiveItem(index, item, value)SLOT = 1Do While SLOT < 24If GetPlayerInvItemNum(index, SLOT) = 0 ThenCall SetPlayerInvItemNum(index, SLOT, item)Call SetPlayerInvItemValue(index, SLOT, value)Call SendInventoryUpdate(index, SLOT)SLOT = 24End IfSLOT = SLOT+1LoopEnd Sub``` Link to comment Share on other sites More sharing options...
Mellowz Posted November 6, 2008 Share Posted November 6, 2008 Like I said, some scripting commands were renamed or removed.The owners of those scripts will have to re-write them. Link to comment Share on other sites More sharing options...
Akselj Posted November 6, 2008 Author Share Posted November 6, 2008 @Scribbles:> Like I said, some scripting commands were renamed or removed.> > The owners of those scripts will have to re-write them.All scripts I have used has previously worked for me with EE 2.7 Link to comment Share on other sites More sharing options...
Mellowz Posted November 7, 2008 Share Posted November 7, 2008 I used the new script debugger in 3.0 and it told me to look at the sub-routine ScriptedSpell().I'll move this post to the "Not A Bug" sub-forum tomorrow so you can look at this. Link to comment Share on other sites More sharing options...
Akselj Posted November 7, 2008 Author Share Posted November 7, 2008 Okay. The problem is scripted spell, cause when I got a problem with that, I sudddenly got errors… Thanks, Scribbles. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now