'*****************************************************'HOUSE COMMANDS!!!!! - Dinand Mentink - Ilnair'*****************************************************Case "/playerhouse build"If GetPlayerMap(index) > 250 or GetPlayerMap(index) < 200 Then Call PlayerMsg(index, "You cannot build here!", 12) Exit SubEnd IfIf GetVar("house.ini", "maps", "" & GetPlayerMap(index) & "owner") = GetPlayerLogin(index) & GetPlayerCharNum(index) Then Call PlayerWarp(index, 499, 0, 0) Call PlayerMsg(index, "Please walk to the left and find a house you like! To buy it step into the south-west corner of the map! This will cost 5000 coins!", 10) Exit SubElse Call PlayerMsg(index, "This is not your house!", 12) Exit SubEnd IfCase "/playerhouse reset"Call ResetHouse(index)Exit SubCase "/playerhouse buy"Call BuyHouse(index)Exit SubCase "/playerhouse item"If GetPlayerMap(index) > 250 or GetPlayerMap(index) < 200 Then Call PlayerMsg(index, "You cannot place items here!", 12) Exit SubEnd IfIf GetVar("house.ini", "maps", "" & GetPlayerMap(index) & "owner") = GetPlayerLogin(index) & GetPlayerCharNum(index) Then Call PutVar("tempvars.ini", "playerhouse", GetPlayerName(index) & "x", GetPlayerX(index) & "") Call PutVar("tempvars.ini", "playerhouse", GetPlayerName(index) & "y", GetPlayerY(index) & "") Call PlayerWarp(index, 490, 0, 0) Call PlayerMsg(index, "Please step on any thing you would like to place on your map!", 10) Exit SubElse Call PlayerMsg(index, "This is not your house!", 12) Exit SubEnd IfExit SubCase "/playerhouse clearowner"If GetPlayerAccess(index) > 0 Then If GetPlayerMap(index) > 199 and GetPlayerMap(index) < 251 Then Call ClearHouse(index, GetPlayerMap(index)) Else Call PlayerMsg(index, "You have to be in a playerhouse to do this!", 12) End IfElse Call PlayerMsg(index, "You have to be a GM to use this command!", 12)End IfExit SubCase "/playerhouse open"locationtemp = GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns")If GetVar("house.ini", "maps", "" & locationtemp & "owner") = GetPlayerLogin(index) & GetPlayerCharNum(index) Then Call PutVar("house.ini", "open", "" & locationtemp, "1") Call PlayerMsg(index, "Your house has opened entrance!", 10)Else Call PlayerMsg(index, "You do not own a house!", 12)End IfExit SubCase "/playerhouse close"locationtemp = GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns")If GetVar("house.ini", "maps", "" & locationtemp & "owner") = GetPlayerLogin(index) & GetPlayerCharNum(index) Then Call PutVar("house.ini", "open", "" & locationtemp, "0") Call PlayerMsg(index, "Your house has closed entrance!", 10)Else Call PlayerMsg(index, "You do not own a house!", 12)End IfExit SubCase "/playerhouse clearitems"locationtemp = GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns")If GetVar("house.ini", "maps", "" & locationtemp & "owner") = GetPlayerLogin(index) & GetPlayerCharNum(index) Then x = GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "template") Call CopyMap(index, x, locationtemp) Call SetTile(GetPlayerMap(index), 18, 13, 10, 2, 4, 7) Call SetSign(GetPlayerMap(index), 18, 13,"PlayerHouse","Owner: " & GetPlayerName(index),"Number: " & locationtemp - 200) Else Call PlayerMsg(index, "You do not own a house!", 12)End IfExit Sub'*****************************************************'END OFHOUSE COMMANDS!!!!! - Dinand Mentink - Ilnair'*****************************************************
'****************************************************************'PLAYERHOUSE SYSTEM, ©Dinand Mentink - ILNAIR!!!!!'****************************************************************Sub CopyMap(index, mapin, mapout)Dim xDim yDim percentDim editxDim edityDim editsetx = 0y = 0percent = 0Call PlayerMsg(index, percent & "% - Please wait while the system builds your house - Building GROUND!", 10)Do While Y < 15 Do While x < 20 editx = GetTileX(mapin, x, y, 0) edity = GetTileY(mapin, x, y, 0) editset = GetTileSet(mapin, x, y, 0) Call SetTile(mapout, x, y, editx, edity, editset, 0) x = x + 1 loopx = 0y = y + 1percent = Int(percent + (100/40))loopx = 0y = 0percent = 20Call PlayerMsg(index, percent & "% - Please wait while the system builds your house - Building ATRIBUTES!", 10)Do While Y < 15 Do While x < 20 editx = GetAttribute(mapin, x, y) If editx = 1 or editx = 4 Then Call SetAttribute(mapout,x,y,editx,0,0,0,"","","") ElseIf editx = 2 Then Call SetAttribute(mapout,x,y,2,258,9,12,"","","") ElseIf editx = 14 Then Call SetSign(GetPlayerMap(index), 18, 13,"PlayerHouse","Owner:","none") Else Call SetAttribute(mapout,x,y,0,0,0,0,"","","") End If x = x + 1 loopx = 0y = y + 1loopx = 0y = 0percent = 40Call PlayerMsg(index, percent & "% - Please wait while the system builds your house - Building WALLS!", 10)Do While Y < 15 Do While x < 20 editx = GetTileX(mapin, x, y, 1) edity = GetTileY(mapin, x, y, 1) editset = GetTileSet(mapin, x, y, 1) Call SetTile(mapout, x, y, editx, edity, editset, 1) x = x + 1 loopx = 0y = y + 1percent = Int(percent + (100/60))loopx = 0y = 0percent = 60Call PlayerMsg(index, percent & "% - Please wait while the system builds your house - Building WALLS!", 10)Do While Y < 15 Do While x < 20 editx = GetTileX(mapin, x, y, 3) edity = GetTileY(mapin, x, y, 3) editset = GetTileSet(mapin, x, y, 3) Call SetTile(mapout, x, y, editx, edity, editset, 3) x = x + 1 loopx = 0y = y + 1percent = Int(percent + (100/60))loopx = 0y = 0percent = 80Call PlayerMsg(index, percent & "% - Please wait while the system builds your house - Building ROOF!", 10)Do While Y < 15 Do While x < 20 editx = GetTileX(mapin, x, y, 5) edity = GetTileY(mapin, x, y, 5) editset = GetTileSet(mapin, x, y, 5) Call SetTile(mapout, x, y, editx, edity, editset, 5) x = x + 1 loopx = 0y = y + 1percent = Int(percent + (100/60))loopCall PlayerMsg(index, "100% - House has been succesfully build!", 10)End SubSub ResetHouse(index)Dim loopvarDim maploopvar = 200Do While loopvar < 251 Call PutVar("house.ini", "maps", "" & loopvar & "", "0") Call PutVar("house.ini", "maps", "" & loopvar & "owner", "0") loopvar = loopvar + 1loopmap = 200Do While map < 251 Call CopyMap(index, 500, map) Call SetTile(map, 18, 13, 10, 2, 4, 7) Call SetSign(map, 18, 13,"PlayerHouse","Owner: none","Number:" & map - 200) map = map + 1loopEnd SubSub BuyHouse(index)Dim itemDim itemslotDim pmapDim pownDim pmcitem = 195 itemslot = GetPlayerInvItemSlot(index, 195)pown = GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns")pmc = GetVar("house.ini", "maps", pown & "owner")pmap = GetVar("house.ini", "maps", "" & pown)If pown > 0 Then If pmap > 0 Then Call PlayerMsg(index, "You already own a house!", 12) Exit Sub End IfEnd IfIf GetPlayerMap(index) < 200 or GetPlayerMap(index) > 250 Then Call PlayerMsg(index, "This house is not for sale!", 12) Exit SubEnd IfIf GetVar("house.ini", "maps", GetPlayerMap(index)) = "1" Then Call PlayerMsg(index, "Somebody else already owns this house!", 12) Exit SubEnd IfIf itemslot = 0 Then Call PlayerMsg(index, "You do not have a house permit!", 12) Exit SubEnd IfCall SetPlayerInvItemNum(index, itemslot, 0)Call SendInventoryUpdate(index, itemslot)Call PutVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns", GetPlayerMap(index))Call PutVar("house.ini", "maps", GetPlayerMap(index), "1")Call PutVar("house.ini", "maps", "" & GetPlayerMap(index) & "owner", GetPlayerLogin(index) & GetPlayerCharNum(index))Call PlayerMsg(index, "You now own this house!", 10)Call SetTile(GetPlayerMap(index), 18, 13, 10, 2, 4, 7)Call SetSign(GetPlayerMap(index), 18, 13,"PlayerHouse","Owner: " & GetPlayerName(index), "Number: " & GetPlayerMap(index) - 200)Call PutVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "template", "500")End SubSub BuildHouse(index)Dim mapDim pmcDim pmapDim itemDim itemslotDim itemvalueDim valueneedmap = GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns")pmap = GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns")pmc = GetVar("house.ini", "maps", map & "owner")If pmc = GetPlayerLogin(index) & GetPlayerCharNum(index) Then item = 1 itemslot = GetPlayerInvItemSlot(index, item) If itemslot = 0 Then Call PlayerMsg(index, "You do not have any money!", 12) Exit Sub End If itemvalue = GetPlayerInvItemValue(index, itemslot) valueneed = 5000 If itemvalue < valueneed Then Call PlayerMsg(index, "You need " & valueneed & " coins to build a house!", 12) Exit Sub ElseIf itemvalue = valueneed Then Call SetPlayerInvItemNum(index, itemslot, 0) Call SetPlayerInvItemValue(index, itemslot, 0) Call SendInventoryUpdate(index, itemslot) ElseIf itemvalue > valueneed Then Call SetPlayerInvItemValue(index, itemslot, itemvalue - valueneed) Call SendInventoryUpdate(index, itemslot) End If map = GetPlayerMap(index) Call PutVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "template", GetPlayerMap(index)) Call PlayerWarp(index, pmap, 8, 8) Call CopyMap(index, map, pmap) Call SetTile(GetPlayerMap(index), 18, 13, 10, 2, 4, 7) Call SetSign(GetPlayerMap(index), 18, 13,"PlayerHouse","Owner: " & GetPlayerName(index),"Number: " & pmap - 200)Else Call PlayerMsg(index, "You do not own a house!", 12) Call PlayerWarp(index, 258, 13, 10) Exit SubEnd IfEnd SubSub ClearHouse(index, map) Call CopyMap(index, 500, map) Call SetTile(map, 18, 13, 10, 2, 4, 7) Call SetSign(map, 18, 13,"PlayerHouse","Owner: none","Number: " & map - 200) Call PutVar("house.ini", "maps", "" & map, "0") Call PutVar("house.ini", "maps", "" & map & "owner", "0")End SubFunction AllowPlayerIn(index, map)AllowPlayerIn = TrueIf map > 250 or map < 200 Then AllowPlayerIn = True Exit FunctionEnd IfIf GetVar("house.ini", "open", "" & map) = "0" Then AllowPlayerIn = FalseEnd IfIf GetVar("house.ini", "maps", "" & map) = "0" Then AllowPlayerIn = TrueEnd IfEnd Function Sub ItemHouse(index)Dim pmapDim mapDim xDim yDim editxDim edityDim editsetDim mapxDim mapyx = GetPlayerX(index)y = GetPlayerY(index)mapx = Int(GetVar("tempvars.ini", "playerhouse", GetPlayerName(index) & "x"))mapy = Int(GetVar("tempvars.ini", "playerhouse", GetPlayerName(index) & "y"))pmap = Int(GetVar("house.ini", GetPlayerLogin(index) & GetPlayerCharNum(index), "owns"))map = Int(GetPlayerMap(index))editx = GetTileX(map, x, y, 3)edity = GetTileY(map, x, y, 3)editset = GetTileSet(map, x, y, 3) If editx = 0 and edity = 0 and editset = 0 Then editx = GetTileX(map, x, y, 5) edity = GetTileY(map, x, y, 5) editset = GetTileSet(map, x, y, 5) Call PlayerWarp(index, pmap, mapx, mapy) Call SetTile(pmap, mapx, mapy, editx, edity, editset, 5) Else Call SetAttribute(pmap,mapx,mapy,1,0,0,0,"","","") Call SetTile(pmap, mapx, mapy, editx, edity, editset, 3) Call PlayerWarp(index, pmap, mapx, mapy)End IfEnd Sub'****************************************************************'End of playerhouse system!, ©Dinand Mentink - ILNAIR!!!!!'****************************************************************
Case 17 Call BuildHouse(index) Exit SubCase 18 x = Int(GetPlayerX(index)) y = Int(GetPlayerY(index)) If x = 1 Then y = y - 2 value = Int(240 + y) Else y = y - 2 y = y * 3 x = x - 4 value = 200 + x + y value = Int(value) End if If AllowPlayerIn(index, value) = True Then Call PlayerWarp(index, value, 19, 14) Exit Sub Else Call PlayerMsg(index, "This house has closed entrance!", 12) Call MapMsg(value, GetPlayerName(index) & " is trying to enter!", 12) Exit Sub End IfCase 19 Call ItemHouse(index) Exit Sub
Sub 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 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 SetItem(map, X, Y, item, value)Call SetAttribute(map,X,Y,3,item,value,0,"","","")End SubSub SetNPCAvoid(map, X, Y)Call SetAttribute(map,X,Y,4,0,0,0,"","","")End SubSub SetKey(map, X, Y, key, take)Call SetAttribute(map,X,Y,5,key,take,0,"","","")End SubSub SetKeyOpen(map, X, Y, keyx, keyy, message)Call SetAttribute(map,X,Y,6,keyx,keyy,0,message,"","")End SubSub SetShop(map, X, Y,shop)Call SetAttribute(map,X,Y,9,shop,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,amap,ax,ay)Call SetAttribute(map,X,Y,11,amap,ax,ay,"","","")End SubSub SetSound(map, X, Y,filename)Call SetAttribute(map,X,Y,12,0,0,0,filename,"","")End SubSub SetSpriteChange(map, X, Y,sprite,item,cost)Call SetAttribute(map,X,Y,13,sprite,item,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 SetChest(map, X, Y)Call SetAttribute(map,X,Y,17,0,0,0,"","","")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 SubSub SetHouse(map, X, Y,item,cost)Call SetAttribute(map,X,Y,21,item,cost,0,"","","")End Sub
Dim PortalDim mapnumDim xDim yDim IDim TextSayDim nDim mDim C Dim locationtempDim playernametempDim invitemslotDim invemptyslotDim valueDim map
hmm...and what about a WORKING pet script...with a pet really following you and attacking players? (no paperdoll fecal matter) :twisted: it's almost done it folows the player and attacks onther players...only need to create some lvl thingy..but that's easy