kenny92316 Posted February 28, 2012 Author Share Posted February 28, 2012 Any ideas to how I could make a npc cast spells or use arrows for range attacks? Any input is appreciated. Link to comment Share on other sites More sharing options...
Robin Posted February 28, 2012 Share Posted February 28, 2012 Add an NPC exception to the spell casting & buffering procedures. Link to comment Share on other sites More sharing options...
kenny92316 Posted February 28, 2012 Author Share Posted February 28, 2012 Buffering would be for arrows, am I right? Link to comment Share on other sites More sharing options...
Ruins of Hell Posted February 28, 2012 Share Posted February 28, 2012 @kenny:> Buffering would be for arrows, am I right?No. He's saying to use the code that is used for NPC spells and adapt it for arrows as well (in this case, the spell casting procedures and buffering procedures). Link to comment Share on other sites More sharing options...
kenny92316 Posted February 29, 2012 Author Share Posted February 29, 2012 Oh alright, thank you for the clarification soul. Link to comment Share on other sites More sharing options...
kenny92316 Posted March 10, 2012 Author Share Posted March 10, 2012 I finally got a chance to poke around the source for subs that would be used for npc attack, I found one but not exactly sure what the data input is refering to. The StartAddr and ExtraVar in specific. The only thing that I noticed is the buffer.readlong, and the two data types are classified as longs in the call of the sub.```Private Sub HandleNpcAttack(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim i As LongDim Buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteBytes Data() i = Buffer.ReadLong ' Set player to attacking MapNpc(i).Attacking = 1 MapNpc(i).AttackTimer = GetTickCount ' Error handler Exit Suberrorhandler: HandleError "HandleNpcAttack", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd 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