Kite Posted September 2, 2009 Author Share Posted September 2, 2009 Sub ScriptedSpell(Index, Script) Select Case Script Case 0 Dim Target Dim Map If GetPlayerTarget(Index) > 0 Then ' Target is a player, exit. Exit Sub Else Target = GetPlayerTargetNpc(Index) Map = GetPlayerMap(Index) If GetMapNpcHP(Map, Target) = 10 Then Call dmgspell(index, 5, 20, 8, 2, "magic1.wav") End If End If Exit Sub Case Else Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd SubThis is what breaks it.If GetMapNpcHP(Map, Target) = 10 ThenIdk what it could be, that if statement works everywhere but in my scriptedspells Link to comment Share on other sites More sharing options...
Kite Posted September 2, 2009 Author Share Posted September 2, 2009 BumpAdded my main.txt, someone look over it please. Link to comment Share on other sites More sharing options...
Bobosk Posted September 2, 2009 Share Posted September 2, 2009 Here… Link to comment Share on other sites More sharing options...
Kite Posted September 2, 2009 Author Share Posted September 2, 2009 No change, the spell still does not work…... Link to comment Share on other sites More sharing options...
Bobosk Posted September 2, 2009 Share Posted September 2, 2009 well, i'm not really an expert in your game, but does the npc you're trying to do this on HAVE 10 hp exactly? Also, assuming it does, why would you damage it for 20..? ~.~ Link to comment Share on other sites More sharing options...
Kite Posted September 2, 2009 Author Share Posted September 2, 2009 It has 30 hp, the point of it being, I cant kill it anymore when it hits 10 hp.So thats why I need a scriptedspell called Data Drain.And Admiral set that up for me. Link to comment Share on other sites More sharing options...
kris_hole Posted September 2, 2009 Share Posted September 2, 2009 Okay.. here i go XD``` Sub ScriptedSpell(Index, Script) Select Case Script Case 0 Dim Target If GetPlayerMp(index) < 10 Then Exit Sub End If If GetPlayerTarget(Index) > 0 Then ' Target is a player, exit. Exit Sub Else Target = GetPlayerTargetNpc(Index) I = 1 Do While I < 50 If IsPlaying(I) Then If GetPlayerMap(I) = GetPlayerMap(index) Then Call PlaySound(I, "magic1.wav") End If End If I = I + 1 Loop If GetMapNpcHP(GetPlayerMap(Index), Target) = 10 Then Call SpellAnim(2, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), target), GetNpcY(GetPlayerMap(index), Target)) Call SetMapNpcHp(GetPlayerMap(index), Target, GetMapNpcHp(GetPlayerMap(index),Target) - 20) Call SetPlayerMp(index, GetPlayerMp(index) - 5) End If End If 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 ```Sub DmgSpell doesnt exists?Let me know how that goes :0 Link to comment Share on other sites More sharing options...
Kite Posted September 2, 2009 Author Share Posted September 2, 2009 It does exists, the npchp is the thing messing it up.Should I try that still though? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted September 2, 2009 Share Posted September 2, 2009 @[THE-KRIS:> link=topic=51270.msg537932#msg537932 date=1251916036]> Okay.. here i go XD> > ```> I = 1> Do While I < 50> If IsPlaying(I) Then> If GetPlayerMap(I) = GetPlayerMap(index) Then> Call PlaySound(I, "magic1.wav")> End If> End If> I = I + 1> Loop> > ```Just use:Call PlaySoundToMap(Index, "magic1.wav")@Tsukasa:> It has 30 hp, the point of it being, I cant kill it anymore when it hits 10 hp.> So thats why I need a scriptedspell called Data Drain.> > And Admiral set that up for me.When testing it, test it on an NPC with exactly 10hp as default. Link to comment Share on other sites More sharing options...
Kite Posted September 2, 2009 Author Share Posted September 2, 2009 I tried, and still failed.I can't give up, cause ther's got to be a reason the if does not work there.It works everywhere else I put it. Link to comment Share on other sites More sharing options...
Admiral Refuge Posted September 2, 2009 Share Posted September 2, 2009 @Tsukasa:> I tried, and still failed.> I can't give up, cause ther's got to be a reason the if does not work there.> It works everywhere else I put it.You're using the main that Bobosk* uploaded now, right?If you have the source on hand, think you can check the clsCommands or w/e it's called, and paste the GetMapNpcHP function for me?*Ballie not upload that ;) Link to comment Share on other sites More sharing options...
Kite Posted September 2, 2009 Author Share Posted September 2, 2009 This is it here.```Function GetMapNpcHP(ByVal MapNum As Long, ByVal Index As Long) As Long GetMapNpcHP = MapNPC(MapNum, Index).HPEnd Function``` Link to comment Share on other sites More sharing options...
kris_hole Posted September 3, 2009 Share Posted September 3, 2009 @Ã…ÃÂüiÑÂôζ:> Just use:> Call PlaySoundToMap(Index, "magic1.wav")> When testing it, test it on an NPC with exactly 10hp as default.i did that so it sends the sound to everyone on the map. otherwise they wont all hear the sound :p Link to comment Share on other sites More sharing options...
Kite Posted September 3, 2009 Author Share Posted September 3, 2009 I replaced it all, it does it on all monsters, but it's the only thing to kill data bugs.I made it a random numbers system, -hp, -mp, death, Infected, ect….If your not on amap I put, it stops it from being used, and sets the random number above what it goes.Anyway all I working good.Locked now 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