Broken_Paladin Posted January 29, 2009 Author Share Posted January 29, 2009 I'm trying to create a scripted AOE spell that plays an animation on all the targets in a few square range and plays a sound. However I tried writing this up but I don't think I did something right, any pointers or suggestions.```Dim TargetDim npcnum Sub ScriptedSpell(Index, Script) Select Case Script Case 0 npcnum = GetPlayerTargetNPC(Index) Call PlaySound(index, "spell1.wav") 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 Exit Sub Case Else Call PlayerMsg(Index, "No spell script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```I'm trying to find the function I think to do AOE foes, AOE allies, self. Is what im not getting a good grasp on. Link to comment Share on other sites More sharing options...
dg1423 Posted January 30, 2009 Share Posted January 30, 2009 check out the ripple effect here:http://www.touchofdeathforums.com/smf/index.php?topic=35680.0 Link to comment Share on other sites More sharing options...
Broken_Paladin Posted January 30, 2009 Author Share Posted January 30, 2009 Thankyou dg I'll give it a try, I missed that when i was going through the forum.I see what I did wrong thank you for all your help, got it working. Link to comment Share on other sites More sharing options...
Broken_Paladin Posted January 30, 2009 Author Share Posted January 30, 2009 I'm using 2.7 and able to buff myself, trying to get the target buff/debuff to work to no avail. (Case 3 spell) Any suggestions or fixes I would appreciate, if the targeting won't work what would you suggest to make it AOE.```' Executes whenever a player casts a scripted spell.Sub ScriptedSpell(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE) Exit Sub Case 1 Call PlayerMsg(Index, "Test 1.", WHITE) Exit Sub Case 2 call StartRipple(index, 5, 5, 2, 75)Exit sub Case 3 If GetPlayerTarget(index) > 0 ThenDim addblahDim playermagplayermag = GetPlayerMAGI(index) / 2b = (int(playermag))Call StatBoost(index, 0, b, b, 0, 5) End IfEnd SelectExit Sub ``````Sub StatBoost(index, str, def, spd, mag, time)dim inusedim playerstrdim playerdefdim playerspddim playermaginuse = GetVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "using")playerstr = GetPlayerSTR(index)playerdef = GetPlayerDEF(index)playerspd = GetPlayerSPEED(index)playermag = GetPlayerMAGI(index)if inuse = "" thenif int(str) > 0 thenCall BattleMsg(index, "Your strength has been boosted by " & str, 14, 1)end ifif int(def) > 0 thenCall BattleMsg(index, "Your defense has been boosted by " & def, 14, 1)end ifif int(spd) > 0 thenCall BattleMsg(index, "Your speed has been boosted by " & spd, 14, 1)end ifif int(mag) > 0 thenCall BattleMsg(index, "Your magic has been boosted by " & mag, 14, 1)end ifCall PutVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "using", 1)Call PutVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "str", "" & str)Call PutVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "def", "" & def)Call PutVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "spd", "" & spd)Call PutVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "mag", "" & mag)Call SetPlayerSTR(index, int(playerstr) + int(str))Call SetPlayerDEF(index, int(playerdef) + int(def))Call SetPlayerSPEED(index, int(playerspd) + int(spd))Call SetPlayerMagi(index, int(playermag) + int(mag))Call SendStats(index)Call SetTimer("StatRelease " & index & "," & str & "," & def & "," & spd & "," & mag, int(time * 1000))elseCall PlayerMsg(index, "You're already boosted!", 15)end ifend subSub StatRelease(index, str, def, spd, mag)dim inusedim playerstrdim playerdefdim playerspddim playermag inuse = GetVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "using")playerstr = GetPlayerSTR(index)playerdef = GetPlayerDEF(index)playerspd = GetPlayerSPEED(index)playermag = GetPlayerMAGI(index)if inuse = "1" thenCall BattleMsg(index, "The effects of you ability increase has worn off.", 4, 1)Call PutVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "StatBoost", "using", "")Call SetPlayerSTR(index, int(playerstr) - int(str))Call SetPlayerDEF(index, int(playerdef) - int(def))Call SetPlayerSPEED(index, int(playerspd) - int(spd))Call SetPlayerMagi(index, int(playermag) - int(mag))Call SendStats(index)Call RemoveTimer("StatRelease " & index & "," & str & "," & def & "," & spd & "," & mag)elseCall PlayerMsg(index, "You're not boosted!", 15)end ifend 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