aeronx Posted August 14, 2015 Author Share Posted August 14, 2015 Hello guys! I've been trying to add full animation for AoE spells.It doesnt give me any compile error, but aparently it doesnt do anything.Any ideas why?Everything on modcombat:Castpell sub:``` If Spell(SpellNum).Type = SPELL_TYPE_DAMAGEHP Then If Spell(SpellNum).IsAoE = True Then InUseArea index, SpellNum DidCast = True End If End If```At the end of modcombat:``` n = Spell(SpellNum).AoE Mapa = GetPlayerMap(index) For x = 0 To n For y = 0 To n SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) - x, GetPlayerY(index) + y SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) + x, GetPlayerY(index) + y SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) - x, GetPlayerY(index) - y SendAnimation Mapa, Spell(SpellNum).SpellAnim, GetPlayerX(index) + x, GetPlayerY(index) - y Next Next For i = 1 To MAX_MAP_NPCS If MapNpc(Mapa).NPC(i).x = x Then If MapNpc(Mapa).NPC(i).y = y Then PlayerAttackNpc index, i, Spell(SpellNum).Vital End If End If Next For i = 1 To Player_HighIndex If i = GetPlayerMap(index) Then Exit Function If GetPlayerMap(i) = Mapa Then If GetPlayerX(i) = x Then If GetPlayerY(i) = y Then PlayerAttackPlayer index, i, Spell(SpellNum).Vital, SpellNum End If End If End If NextEnd Function```Thanks for your time! Link to comment Share on other sites More sharing options...
Abyss Posted August 14, 2015 Share Posted August 14, 2015 Isnt there already an option to give and take items? Link to comment Share on other sites More sharing options...
aeronx Posted August 14, 2015 Author Share Posted August 14, 2015 Yes, there is. But that option doesnt work as intended. If you set it to take 100 items, it will take up to 100, it doesnt check if you have 100 or 2.What i need is to check 100 items, if player has 99, should not work and do any other thing. Link to comment Share on other sites More sharing options...
Abyss Posted August 14, 2015 Share Posted August 14, 2015 That doesnt sound like a hard thing to fix though..Anyways, you could always just do a repeatable quest if you don't know how to fix that. Link to comment Share on other sites More sharing options...
Coyote Posted August 14, 2015 Share Posted August 14, 2015 ```Dim i as longfor i = 1 to max_inv_items'not sure if its max_invitems or somethingif GetPlayerInvItemNum(index,i) = ItemNumberYouNeed then'Do somethingend ifnext``` Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted August 14, 2015 Share Posted August 14, 2015 It looks like on your code you're only checking the 3rd inventory slot? I could be wrong, but that's what it looks like. Link to comment Share on other sites More sharing options...
aeronx Posted August 15, 2015 Author Share Posted August 15, 2015 Thanks all, i did solve it the problem, thanks to GoranM!I've been thinking on adding a restriction to spells. Like Cast spell 1 to be able to cast spell 2.Is there any "easy" way to do it? I think that would help many ppl, since with that you can acomplish combo with spells andit could be a nice feature. Anyone has anything on it? thanks for your time guys! Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted August 15, 2015 Share Posted August 15, 2015 You'd have to add something to the server loop that activates when the player is casting as spell, also add something to the spell rec Link to comment Share on other sites More sharing options...
aeronx Posted August 15, 2015 Author Share Posted August 15, 2015 Thanks for your fast answer baron! But i think ill need a bit more help than that since i dont know how to actually writte code, i can just modify or add something already written xDYep, im that sad XD* * *Out of topic.I've been working on a code for npcs stay in range if they can cast spells or throw projectiles. Basically i want npcs to run away from me if i get close to them.Maybe you can point me in the right direction, and thanks for your time guys, really appreciate it.```If MapNpc(mapnum).NPC(x).y > targetY And "Npc_behaviour_walkaway" And NPC(NPCNum).range > 0 And Not didwalk Then If CanNpcMove(mapnum, x, DIR_DOWN) Then Call NpcMove(mapnum, x, DIR_DOWN, MOVING_WALKING) didwalk = True End If End If``` Link to comment Share on other sites More sharing options...
aeronx Posted August 27, 2015 Author Share Posted August 27, 2015 Bump! Check first post please it new, but i didnt want to create a new post! thanks 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