munro Posted July 31, 2007 Author Share Posted July 31, 2007 ```dim addattackdim adddefencedim petattackdim petdefencedim pethpdim targetattackdim targetdefencedim targethpdim expselect case npcnumber Case 1owner = FindPlayer(GetVar("pets\pet.ini", "PET" & npcnumber, "owner"))if npcnumber > 500 thenexit subend ifif "" & FindPlayer(GetVar("pets\pet.ini", "PET" & npcnumber, "owner")) = "" thencall ScriptSpawnNpc(mapnpcnum, MapNum, GetNpcX(MapNum, MapNpcNum), GetNpcy(MapNum, MapNpcNum), 0)exit subend ifif isplaying(owner) = "False" or isplaying(owner) = "" thenexit subend ifif 0 + GetMapNpcHP(MapNum, mapnpcnum) < 1 thencall ScriptSpawnNpc(mapnpcnum, MapNum, GetNpcX(MapNum, MapNpcNum), GetNpcy(MapNum, MapNpcNum), 0)call putVar("pets\pet.ini", "PET" & npcnumber, "owner", "")exit subend if if 0 + GetMapNpcHP(MapNum, mapnpcnum) < 1 thencall ScriptSpawnNpc(mapnpcnum, MapNum, GetNpcX(MapNum, MapNpcNum), GetNpcy(MapNum, MapNpcNum), 0)call putVar("pets\pet.ini", "PET" & npcnumber, "owner", "")exit subend if if getplayertarget(owner) > 0 thenif 0 + val(getplayermap(owner)) = 0 + val(getplayermap(getplayertarget(owner))) thencall SetMapNpcTARGET( mapnum, mapnpcnum, getplayertarget(owner))end ifelseif getplayertargetnpc(owner) <> 0 thenn = 0if GetNpcX(mapnum, getplayertargetnpc(owner)) < x then Call NpcMoving(MapNum, MapNpcNum, 2, 1) Exit Subend ifif GetNpcX(mapnum, getplayertargetnpc(owner)) > x then Call NpcMoving(MapNum, MapNpcNum, 3, 1) Exit Subend ifif GetNpcY(mapnum, getplayertargetnpc(owner)) < Y - 1 then Call NpcMoving(MapNum, MapNpcNum, 0, 1) Exit Subend ifif GetNpcY(mapnum, getplayertargetnpc(owner)) > Y + 1 then Call NpcMoving(MapNum, MapNpcNum, 1, 1) Exit Subend if'attacking the oher npc and recieving damageaddattack = 1 + GetVar("pets\pet.ini", "ITEMS", "hatadd" & npcnumber) + GetVar("pets\pet.ini", "ITEMS", "weaponadd" & npcnumber)adddefence = 1 + GetVar("pets\pet.ini", "ITEMS", "armoradd" & npcnumber)petattack = GetNpcStrength(npcnumber) + Int((GetNpcStrength(npcnumber) / 6 - addattack + 1) * Rnd) + addattackpetdefence = GetNpcDefence(npcnumber) + Int((GetNpcDefence(npcnumber) / 6 - adddefence + 1) * Rnd) + adddefencepethp = Int(GetMapNpcHP( MapNum, mapnpcnum))targetattack = GetNpcStrength(GetMapNPCnumber( MapNum, getplayertargetnpc(owner))) + Int((GetNpcStrength(GetMapNPCnumber( MapNum, getplayertargetnpc(owner))) / 6 - 1 + 1) * Rnd) + 1targetdefence = GetNpcDefence(GetMapNPCnumber( MapNum, getplayertargetnpc(owner))) + Int((GetNpcDefence(GetMapNPCnumber( MapNum, getplayertargetnpc(owner))) / 6 - 1 + 1) * Rnd) + 1targethp = Int(GetMapNpcHP( MapNum, getplayertargetnpc(owner)))if isplaying(owner) = "false" or isplaying(owner) = "" thenexit subend ifif pethp - targetattack + petdefence < 1 thenCall battlemsg(owner, "you're pet has been killed in battle.", 14, 0)call ScriptSpawnNpc(mapnpcnum, MapNum, GetNpcX(MapNum, MapNpcNum), GetNpcy(MapNum, MapNpcNum), 0)elseCall battlemsg(owner, "Pet hp " & pethp - targetattack + petdefence & "/" & GetNpcMaxhp(mapnpcnum), 14, 0)call SetMapNpcHP( MapNum, npcnumber, pethp - targetattack + petdefence) end ifif targethp - petattack + targetdefence < 1 thencall ScriptSpawnNpc(getplayertargetnpc(owner), MapNum, GetNpcX(MapNum, getplayertargetnpc(owner)), GetNpcy(MapNum, getplayertargetnpc(owner)), 0)Call battlemsg(owner, "you're pet has killed an enemy.", 14, 1)elseCall battlemsg(owner, "Npc hp " & targethp - petattack + targetdefence & "/" & GetNpcMaxhp(GetMapNPCnumber(MapNum, getplayertargetnpc(owner))), 14, 1)call SetMapNpcHP( MapNum, GetMapNPCnumber(MapNum, getplayertargetnpc(owner)), targethp - petattack + targetdefence)end ifcall playermsg(owner, "test",1)else If GetPlayerX(owner) < x - 1 Then Call NpcMoving(MapNum, MapNpcNum, 2, 1) Exit Sub End If If GetPlayerX(owner) - 1 > x Then Call NpcMoving(MapNum, MapNpcNum, 3, 1) Exit Sub End If If GetPlayery(owner) < y - 1 Then Call NpcMoving(MapNum, MapNpcNum, 0, 1) Exit Sub End If If GetPlayery(owner) - 1 > y Then Call NpcMoving(MapNum, MapNpcNum, 1, 1) Exit Sub End Ifend ifend ifend select'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' This sub runs when any player presses the Delete keySub HotScript2(index)'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dim npcnumberi = 1do while i <= 25if 0 + GetMapNPCnumber(getplayermap(index), i) = 0 thennpcnumber = 0 + getvar("pets\pet.ini", "PETS", getplayername(index))Call putvar("pets\pet.ini", "PET" & npcnumber, "owner", "" & trim(getplayername(index)) )call ScriptSpawnNpc( i, getplayermap(index), getplayerx(index), getplayery(index), npcnumber)i = 27elsei = i + 1end ifloopif i = 27 thencall playermsg(index, "You summoned your pet.", 1)elsecall playermsg(index, "You can't summon your pet.", 1)end ifEnd Sub'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' This sub runs when players press the End keySub HotScript3(index) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Telling players the game time'Call playermsg(index, "The time is " & getservertimehour() & ":" & getservertimeminute() & ":" & getservertimesecond() , 14)' Loads the shop with new stuff'call reloadshop(1)Call CustomMenuShow(index, "Pet equipment", "\GUI\CUSTOM\menustone.gif", 1)Call CustomMenuLabel(index, 1, "Pet equipment", 45, 15, 8, 15, 0, 400, 40)call CustomMenuPicture(index, 1, "\GUI\CUSTOM\itembg.jpg", 62, 100)call CustomMenuPicture(index, 2, "\GUI\CUSTOM\itembg.jpg", 62, 137)call CustomMenuPicture(index, 3, "\GUI\CUSTOM\itembg.jpg", 100, 100)petnumber = 0 + getvar("pets\pet.ini", "PETS", getplayername(index))if 0 + getvar("pets\pet.ini", "PET" & petnumber, "hat") <> 0 thencall CustomMenuPicture(index, 4, "\GUI\CUSTOM\pethat" & getvar("pets\pet.ini", "PET" & petnumber, "hat") & ".jpg", 64, 102)end ifif 0 + getvar("pets\pet.ini", "PET" & petnumber, "armor") <> 0 thencall CustomMenuPicture(index, 5, "\GUI\CUSTOM\petarmor" & getvar("pets\pet.ini", "PET" & petnumber, "armor") & ".jpg", 64, 139)end ifif 0 + getvar("pets\pet.ini", "PET" & petnumber, "weapon") <> 0 thencall CustomMenuPicture(index, 6, "\GUI\CUSTOM\petweapon" & getvar("pets\pet.ini", "PET" & petnumber, "weapon") & ".jpg", 102, 102)end ifEnd Sub```where would i put this script i know where hotscript goes but the stuff before that where does it go? 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