iHero Posted May 21, 2013 Author Share Posted May 21, 2013 **Introduction**The animation of the attack of NPC is only sent when the NPC cause damage to the player.**Server~Side**> modCombatFind:```Sub NpcAttackPlayer(ByVal mapNpcNum As Long, ByVal victim As Long, ByVal Damage As Long)```In _Sub NpcAttackPlayer_ find:``` ' Send this packet so they can see the npc attacking Set Buffer = New clsBuffer Buffer.WriteLong ServerPackets.SNpcAttack Buffer.WriteLong mapNpcNum SendDataToMap MapNum, Buffer.ToArray() Set Buffer = Nothing```Erase. Now in _Function CanNpcAttackPlayer_ find:``` Dim npcNum As Long```Below add:``` Dim Buffer As clsBuffer```Find:``` MapNpc(MapNum).Npc(mapNpcNum).AttackTimer = GetTickCount```Above add:``` ' Send this packet so they can see the npc attacking Set Buffer = New clsBuffer Buffer.WriteLong ServerPackets.SNpcAttack Buffer.WriteLong mapNpcNum SendDataToMap MapNum, Buffer.ToArray() Set Buffer = Nothing```In _Sub TryNpcAttackPlayer_ find:``` If Damage > 0 Then Call NpcAttackPlayer(mapNpcNum, index, Damage)```Below add:``` Else SendActionMsg mapNum, "Block!", Cyan, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32)```Credits**Ricard**o Link to comment Share on other sites More sharing options...
UzGo Posted September 13, 2013 Share Posted September 13, 2013 Great !!! I am delighted to see tutorial about this bug ! Keep in mind that your work is very helpful ! 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