Sheker Posted April 3, 2012 Author Share Posted April 3, 2012 Implementing Lightning's Pet System on CS:DE, and everything works but one line.``` ' ///////////////////////////////////////////// ' // This is used for npcs to attack targets // ' ///////////////////////////////////////////// ' Make sure theres a npc with the map If Map(mapNum).Npc(x) > 0 And MapNpc(mapNum).Npc(x).Num > 0 Then target = MapNpc(mapNum).Npc(x).target targetType = MapNpc(mapNum).Npc(x).targetType ' Check if the npc can attack the targeted player player If target > 0 Then If targetType = 1 Then ' player ' Is the target playing and on the same map? If IsPlaying(target) And GetPlayerMap(target) = mapNum Then ' melee combat TryNpcAttackPlayer x, target ElseIf targetType = 2 Then ' lol no npc combat :( DATS WAT YOU THINK If CanNpcAttackNpc(mapNum, x, MapNpc(mapNum).Npc(x).target) = True Then Call NpcAttackNpc(mapNum, x, MapNpc(mapNum).Npc(x).target, Npc(Map(mapNum).Npc(x)).Damage) End If Else ' Player left map or game, set target to 0 MapNpc(mapNum).Npc(x).target = 0 MapNpc(mapNum).Npc(x).targetType = 0 ' clear End If End If End If ' check for spells If MapNpc(mapNum).Npc(x).spellBuffer.Spell = 0 Then ' loop through and try and cast our spells For i = 1 To MAX_NPC_SPELLS If Npc(npcNum).Spell(i) > 0 Then NpcBufferSpell mapNum, x, i End If Next Else ' check the timer If MapNpc(mapNum).Npc(x).spellBuffer.Timer + (Spell(Npc(npcNum).Spell(MapNpc(mapNum).Npc(x).spellBuffer.Spell)).CastTime * 1000) < GetTickCount Then ' cast the spell NpcCastSpell mapNum, x, MapNpc(mapNum).Npc(x).spellBuffer.Spell, MapNpc(mapNum).Npc(x).spellBuffer.target, MapNpc(mapNum).Npc(x).spellBuffer.tType ' clear the buffer MapNpc(mapNum).Npc(x).spellBuffer.Spell = 0 MapNpc(mapNum).Npc(x).spellBuffer.target = 0 MapNpc(mapNum).Npc(x).spellBuffer.Timer = 0 MapNpc(mapNum).Npc(x).spellBuffer.tType = 0 End If End If End If```"Call NpcAttackNpc" is highlighted in "Call NpcAttackNpc(mapNum, x, MapNpc(mapNum).Npc(x).target, Npc(Map(mapNum).Npc(x)).Damage)", and I tried to comment it out and it compiled properly. Does anybody know what's wrong? Link to comment Share on other sites More sharing options...
Yxxe Posted April 3, 2012 Share Posted April 3, 2012 @Sheker:> -snip-Maybe because I wrote the tutorial before CS:DE was even released? Link to comment Share on other sites More sharing options...
Sheker Posted April 3, 2012 Author Share Posted April 3, 2012 It should work. I compared the systems in CS:DE and EO2.0 that are edited in this system, and they're practically the same. What's wrong with it? 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