Diskmaster Posted August 1, 2009 Author Share Posted August 1, 2009 Can any 1 c if there is a syntax error or something for me, thx!```Case 62If GetPlayerHP(index)<251 ThenCall PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)ElseCall SpellAnim(202, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)Call SetMapNpcHP( 89, 194, GetMapNpcHP( 89, 194)- GetPlayerHP(index))Call SetPlayerHP(index, 5)Call MapMsg(GetPlayerMap(index), GetPlayerName(index)"Just hit the boss with an HP strike, now the boss has" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)End IfCase 63If GetPlayerMP(index)<251 ThenCall PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)Else Call SpellAnim(204, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)Call SpellAnim(203, GetPlayerMap(index), 13, 3)Call SpellAnim(203, GetPlayerMap(index), 14, 3)Call SpellAnim(203, GetPlayerMap(index), 15, 3)Call SpellAnim(203, GetPlayerMap(index), 16, 3)Call SpellAnim(203, GetPlayerMap(index), 17, 3)Call SpellAnim(203, GetPlayerMap(index), 13, 4)Call SpellAnim(203, GetPlayerMap(index), 14, 4)Call SpellAnim(203, GetPlayerMap(index), 15, 4)Call SpellAnim(203, GetPlayerMap(index), 16, 4)Call SpellAnim(203, GetPlayerMap(index), 17, 4)Call SetMapNpcHP(89, 194, GetMapNpcHP( 89, 194)- GetPlayerMP(index))Call SetPlayerHP(index, 5)Call MapMsg(GetPlayerMap(index), "WOW"GetPlayerName(index)"Just hit the boss with an MP strike, now the boss has" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)End IfCase 64Call SetMapNpcHP( 89, 194, GetMapNpcHP( 89, 194)- GetPlayerHP(index))Call SetMapNpcHP( 89, 1194, GetMapNpcHP( 89, 194)- GetPlayerMP(index))Call SetPlayerHP(index, GetPlayerHP(index)-GetPlayerHP(index))Call MapMsg(GetPlayerMap(index), GetPlayerName(index)"Just sacraficed himself to strike the boss, now the boss has" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)Case 65Call Prompt(index, "If you use this beacon, it will cause instant death to you, but will cause massive damage to the boss, still proceed?", 17)```Oh, and they are scripted tiles Link to comment Share on other sites More sharing options...
DarkSpine Posted August 2, 2009 Share Posted August 2, 2009 @Diskmaster:> Can any 1 c if there is a syntax error or something for me, thx!> > ```> Case 62> If GetPlayerHP(index)<251 Then> Call PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)> Else> Call SpellAnim(202, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)> Call SetMapNpcHP( 89, 194, GetMapNpcHP( 89, 194)- GetPlayerHP(index))> Call SetPlayerHP(index, 5)> Call MapMsg(GetPlayerMap(index), GetPlayerName(index)"Just hit the boss with an HP strike, now the boss has" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)> End If> > Case 63> If GetPlayerMP(index)<251 Then> Call PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)> Else > Call SpellAnim(204, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)> Call SpellAnim(203, GetPlayerMap(index), 13, 3)> Call SpellAnim(203, GetPlayerMap(index), 14, 3)> Call SpellAnim(203, GetPlayerMap(index), 15, 3)> Call SpellAnim(203, GetPlayerMap(index), 16, 3)> Call SpellAnim(203, GetPlayerMap(index), 17, 3)> Call SpellAnim(203, GetPlayerMap(index), 13, 4)> Call SpellAnim(203, GetPlayerMap(index), 14, 4)> Call SpellAnim(203, GetPlayerMap(index), 15, 4)> Call SpellAnim(203, GetPlayerMap(index), 16, 4)> Call SpellAnim(203, GetPlayerMap(index), 17, 4)> Call SetMapNpcHP(89, 194, GetMapNpcHP( 89, 194)- GetPlayerMP(index))> Call SetPlayerHP(index, 5)> Call MapMsg(GetPlayerMap(index), "WOW"GetPlayerName(index)"Just hit the boss with an MP strike, now the boss has" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)> End If> > Case 64> Call SetMapNpcHP( 89, 194, GetMapNpcHP( 89, 194)- GetPlayerHP(index))> Call SetMapNpcHP( 89, 1194, GetMapNpcHP( 89, 194)- GetPlayerMP(index))> Call SetPlayerHP(index, GetPlayerHP(index)-GetPlayerHP(index))> Call MapMsg(GetPlayerMap(index), GetPlayerName(index)"Just sacraficed himself to strike the boss, now the boss has" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)> > Case 65> Call Prompt(index, "If you use this beacon, it will cause instant death to you, but will cause massive damage to the boss, still proceed?", 17)> > ```> Oh, and they are scripted tilesTry this:```Case 62If GetPlayerHP(index) < 251 ThenCall PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)ElseCall SpellAnim(202, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)Call SetMapNpcHP( 89, 194, GetMapNpcHP( 89, 194)- GetPlayerHP(index))Call SetPlayerHP(index, 5)Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " Just hit the boss with an HP strike, now the boss has" & GetMapNpcHP( 89, 194) & " HP Left!", BRIGHTGREEN)End IfCase 63If GetPlayerMP(index) < 251 ThenCall PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)Else Call SpellAnim(204, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)Call SpellAnim(203, GetPlayerMap(index), 13, 3)Call SpellAnim(203, GetPlayerMap(index), 14, 3)Call SpellAnim(203, GetPlayerMap(index), 15, 3)Call SpellAnim(203, GetPlayerMap(index), 16, 3)Call SpellAnim(203, GetPlayerMap(index), 17, 3)Call SpellAnim(203, GetPlayerMap(index), 13, 4)Call SpellAnim(203, GetPlayerMap(index), 14, 4)Call SpellAnim(203, GetPlayerMap(index), 15, 4)Call SpellAnim(203, GetPlayerMap(index), 16, 4)Call SpellAnim(203, GetPlayerMap(index), 17, 4)Call SetMapNpcHP(89, 194, GetMapNpcHP( 89, 194)- GetPlayerMP(index))Call SetPlayerHP(index, 5)Call MapMsg(GetPlayerMap(index), "WOW " & GetPlayerName(index) &" Just hit the boss with an MP strike, now the boss has" & GetMapNpcHP( 89, 194) & " HP Left!", BRIGHTGREEN)End IfCase 64Call SetMapNpcHP( 89, 194, GetMapNpcHP( 89, 194)- GetPlayerHP(index))Call SetMapNpcHP( 89, 1194, GetMapNpcHP( 89, 194)- GetPlayerMP(index))Call SetPlayerHP(index, GetPlayerHP(index)-GetPlayerHP(index))Call MapMsg(GetPlayerMap(index), GetPlayerName(index) &" Just sacraficed himself to strike the boss, now the boss has" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)Case 65Call Prompt(index, "If you use this beacon, it will cause instant death to you, but will cause massive damage to the boss, still proceed?", 17)```Btw, turn on your script errors and tell me if you get one after my edits. Link to comment Share on other sites More sharing options...
Bobosk Posted August 2, 2009 Share Posted August 2, 2009 ```SetMapNpcHP( 89, 194, GetMapNpcHP( 89, 194)- GetPlayerHP(index))```Call SetMapNpcHP( MapNum, npc_Index, HitPoints)npc_Index, refers to the number of npc they are on the map(up to 15)```GetMapNpcHP( 89, 194)```Function GetMapNpcHP( MapNum, Index)Index, refers to the number of the npc they are on the map(up to 15)So your 89, is the map, which is more or less correct, aslong as it's a number <= your max_mapsbut your 194… is way off, UNLESS you decided to make your game able to handle up to 194 npcs per map through the source...Good DAY.. i'll look at more when i have some time.. Link to comment Share on other sites More sharing options...
Diskmaster Posted August 2, 2009 Author Share Posted August 2, 2009 OOOOOOOOH, thx bobosk, and, I wasn't getting any errors BUT, it wasn't working, thx (every day I try to master a new part of Sadscript) Link to comment Share on other sites More sharing options...
Diskmaster Posted August 7, 2009 Author Share Posted August 7, 2009 sry 2 bring this topic up again, but it STILL doesn't work, and Spechno, it says there is an expected ')' in :```Call MapMsg(GetPlayerMap(index), GetPlayerName(index) &" Just sacraficed himself to strike the boss" GetMapNpcHP( 89, 194)"HP Left!", BRIGHTGREEN)```and a type mismach 1 whenever I step on one of the scripted tiles Link to comment Share on other sites More sharing options...
Bobosk Posted August 8, 2009 Share Posted August 8, 2009 ```Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " Just sacraficed himself to strike the boss has " & GetMapNpcHP( 89, 194) & "HP Left!", BRIGHTGREEN)```once again, you forgot the &'s before/after getmapnpchp, and you're using that command wrong AGAIN Link to comment Share on other sites More sharing options...
Diskmaster Posted August 8, 2009 Author Share Posted August 8, 2009 I just fixed it, and made it call for the onNPCDeath sub if the NPC in question has less than 1 hp. (with these tiles, I managed to kill it in one hit) on the bottom screen, it said You Killed a . I know I have the map # right and the npc I want it to damage is #1 on the map, but that NPC won't die, nothing dies?? R u sure index is referring to that(I see why it would be) Because it is failing (no error messages, just not working right) Here is the script:```Case 62If GetPlayerHP(index) < 251 ThenCall PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)ElseCall SpellAnim(204, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)Call SpellAnim(203, GetPlayerMap(index), 13, 3)Call SpellAnim(203, GetPlayerMap(index), 14, 3)Call SpellAnim(203, GetPlayerMap(index), 15, 3)Call SpellAnim(203, GetPlayerMap(index), 16, 3)Call SpellAnim(203, GetPlayerMap(index), 17, 3)Call SpellAnim(203, GetPlayerMap(index), 13, 4)Call SpellAnim(203, GetPlayerMap(index), 14, 4)Call SpellAnim(203, GetPlayerMap(index), 15, 4)Call SpellAnim(203, GetPlayerMap(index), 16, 4)Call SpellAnim(203, GetPlayerMap(index), 17, 4)Call SetMapNpcHP( 89, 1, GetMapNpcHP( 89, 1)- GetPlayerHP(index))Call SetPlayerHP(index, 5)Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " Just hit the boss with an HP strike, now the boss has" & GetMapNpcHP( 89, 1) & " HP Left!", BRIGHTGREEN)If GetMapNpcHP(89, 1)<1 ThenCall OnNPCDeath(Index, Map, NPCNum, NPCIndex)End If End IfCase 63If GetPlayerMP(index) < 500 ThenCall PlayerMsg(index, "You feel too weak to fire the beacon!", BRIGHTRED)Else Call SpellAnim(204, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)Call SpellAnim(203, GetPlayerMap(index), 13, 3)Call SpellAnim(203, GetPlayerMap(index), 14, 3)Call SpellAnim(203, GetPlayerMap(index), 15, 3)Call SpellAnim(203, GetPlayerMap(index), 16, 3)Call SpellAnim(203, GetPlayerMap(index), 17, 3)Call SpellAnim(203, GetPlayerMap(index), 13, 4)Call SpellAnim(203, GetPlayerMap(index), 14, 4)Call SpellAnim(203, GetPlayerMap(index), 15, 4)Call SpellAnim(203, GetPlayerMap(index), 16, 4)Call SpellAnim(203, GetPlayerMap(index), 17, 4)Call SetMapNpcHP(89, 1, GetMapNpcHP( 89, 1)- GetPlayerMP(index))Call SetPlayerMP(index, 5)Call MapMsg(GetPlayerMap(index), "WOW " & GetPlayerName(index) &" Just hit the boss with an MP strike, now the boss has" & GetMapNpcHP( 89, 1) & " HP Left!", BRIGHTGREEN)If GetMapNpcHP(89, 1)<1 ThenCall OnNPCDeath(Index, Map, NPCNum, NPCIndex)End If End IfCase 64Call SpellAnim(205, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index)-1)Call SpellAnim(206, GetPlayerMap(index), 13, 3)Call SpellAnim(206, GetPlayerMap(index), 14, 3)Call SpellAnim(206, GetPlayerMap(index), 15, 3)Call SpellAnim(206, GetPlayerMap(index), 16, 3)Call SpellAnim(206, GetPlayerMap(index), 17, 3)Call SpellAnim(206, GetPlayerMap(index), 13, 4)Call SpellAnim(206, GetPlayerMap(index), 14, 4)Call SpellAnim(206, GetPlayerMap(index), 15, 4)Call SpellAnim(206, GetPlayerMap(index), 16, 4)Call SpellAnim(206, GetPlayerMap(index), 17, 4)Call SetMapNpcHP( 89, 1, GetMapNpcHP( 89, 1)- GetPlayerHP(index))Call SetMapNpcHP( 89, 1, GetMapNpcHP( 89, 1)- GetPlayerMP(index))Call SetPlayerHP(index, GetPlayerHP(index)-GetPlayerHP(index))Call MapMsg(GetPlayerMap(index), GetPlayerName(index) & " Just sacraficed himself to strike the boss has " & GetMapNpcHP( 89, 1) & "HP Left!", BRIGHTGREEN)Call OnDeath(Index)If GetMapNpcHP(89, 1)<1 ThenCall OnNPCDeath(Index, Map, NPCNum, NPCIndex)End IfCase 65Call Prompt(index, "If you use this beacon, it will cause instant death to you, but will cause massive damage to the boss, still proceed?", 17)``` Link to comment Share on other sites More sharing options...
Bobosk Posted August 8, 2009 Share Posted August 8, 2009 That would be, because you're not defining "NPCNum" or "NPCIndex" when you're calling OnNPCDeath, therefore, it doesn't have anything to get as a name in your sub onnpcdeath Link to comment Share on other sites More sharing options...
Diskmaster Posted August 8, 2009 Author Share Posted August 8, 2009 ok, I get it, thx (I thought I was just calling a sub) 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