Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Joost

Members
  • Posts

    224
  • Joined

  • Last visited

    Never

Everything posted by Joost

  1. http://www.youtube.com/watch?v=lskNTCzdLNE
  2. Joost

    Pet Walk bug fix!!

    The purpose of deleting commented out code is jack shit.
  3. Had to fix my fix, should be 100% working now.
  4. ``` If GetPlayerClass(index) = *Insert the number of the class here* Then Vital = *add your own little formula here* ```Add that below the other code. You can also use a select case like you mentioned, this would look like ``` Select Case Getplayerclass(index) Case 0 Vital = Vital + something Case 1 Vital = Vital + something else End select ```
  5. Attached is the source code added into a vanilla version of EO. Just take a look at that if you want to know where things go in more detail.
  6. The subs you can just add to the bottom of the gamelogic module. The rest of the code needs to replace the default code for targetting, you should be able to figure it out.
  7. I tried finding some of the old Elpis pics but everything was on the splamm site that probably died years ago =(.
  8. Updated the code a bit to make sure I never find out what happens if there are too many people on the threat list by increasing the threat list to 15\. The only problem that can arise atm is the list not being reset properly at some point (works when player leaves map, disconnects, or warps but there might be other reasons) and that would be easily fixable. I'd say this is ready to be added to any game, especially since it is such a major major improvement over the old AI.
  9. In that case it works 100%. Trust me.
  10. **The current way things work** The NPC hits the last thing that attacked it. Whether this was the guy with the huge sword or the guy giving him a backrub is irrelevant, you touch me last, I kill you now. This also has the side-effect of the NPC spasming out while trying to attack every single one of the 4 people hitting him at the same time. **What this does** This gives all NPC's a list of a number between ~~3 and 5 targets~~ 15 targets and how much damage they did to that NPC. The NPC will always attack the person who did the most damage to it. This means that you can have a setup with one warrior class tank designed for keeping the NPC's attention while the mages and rogues do damage to the NPC. The WoW definition of threat (what this simulates) is "_Threat is a measure of an NPC's aggression (often called "aggro") towards a player. Each NPC has a threat table, and the character at the top of the list is usually the target of its aggression. In-game, this is known as having aggro from that particular NPC. The NPC will attack that character if possible, unless another character manages to change the NPC's target. The tanking role usually has to pay particular attention to threat and how to hold it_." **What is tested** Every possible scenario involving 2 players. **What's still missing** It doesn't take into account healing as a mechanic of getting threat. **The code** All of this stuff is server-side of course, since server handles everything AI-related. First of all, some subs ``` Sub CheckTarget(ByVal MapNum As Long, ByVal MapNpcNum As Long) Dim i As Byte, CurrentThreat As Long, y As Byte For i = 0 To 14 'MsgBox (x) If MapNpc(MapNum).Npc(MapNpcNum).threat(i) > CurrentThreat Then CurrentThreat = MapNpc(MapNum).Npc(MapNpcNum).threat(i) y = i End If Next i If CurrentThreat = 0 Then MapNpc(MapNum).Npc(MapNpcNum).Target = 0 MapNpc(MapNum).Npc(MapNpcNum).targetType = 0 Else MapNpc(MapNum).Npc(MapNpcNum).Target = MapNpc(MapNum).Npc(MapNpcNum).Posstarget(y) MapNpc(MapNum).Npc(MapNpcNum).targetType = 1 End If End Sub Sub AdjustThreat(ByVal MapNum As Long, ByVal MapNpcNum As Long, ByVal Index As Long, ByVal Damage As Long) Dim i As Byte, Updated As Boolean 'This is if you have like a warrior class that you want to have tanking 'If GetPlayerClass(Index) = WARRIOR Then ' Damage = Damage * 1.3 ' Damage = Damage + 50 'End if For i = 0 To 14 If MapNpc(MapNum).Npc(MapNpcNum).Posstarget(i) = Index Then 'Check if player is already in threat list MapNpc(MapNum).Npc(MapNpcNum).threat(i) = MapNpc(MapNum).Npc(MapNpcNum).threat(i) + Damage Updated = True Exit For End If Next i If Updated = False Then For i = 0 To 14 If MapNpc(MapNum).Npc(MapNpcNum).Posstarget(i) = 0 Then MapNpc(MapNum).Npc(MapNpcNum).Posstarget(i) = Index MapNpc(MapNum).Npc(MapNpcNum).threat(i) = Damage Updated = True Exit For End If Next i End If End Sub Sub RemoveThreat(Index As Long, MapNum As Long, MapNpcNum As Long) Dim i As Byte For i = 0 To 14 If MapNpc(MapNum).Npc(MapNpcNum).Posstarget(i) = Index Then MapNpc(MapNum).Npc(MapNpcNum).Posstarget(i) = 0 MapNpc(MapNum).Npc(MapNpcNum).threat(i) = 0 Exit For End If Next i Call CheckTarget(MapNum, MapNpcNum) End Sub Sub ResetThreat(ByVal MapNum As Long, MapNpcNum As Long) Dim i As Byte For i = 0 To 14 MapNpc(MapNum).Npc(MapNpcNum).Posstarget(i) = 0 MapNpc(MapNum).Npc(MapNpcNum).threat(i) = 0 Next i End Sub ``` Let's go trough them one by one. Sub CheckTarget is just something that checks what target on the NPC's list is highest on the list and should be attacked next. Sub AdjustThreat gives a player his threat after doing damage. The threat given is equal to the damage done. RemoveThreat and ResetThreat are both ways of clearing the memory, ResetThreat is for players(logoff), RemoveThreat is for the entire list (npc dies). In the Private Type MapNpcRec, we need to define the new properties, so add the below code in there. This just defines the variables that keep track of all the aggro list for all NPC's ``` Posstarget(0 To 15) As Long threat(0 To 15) As Long ``` Now, onto the part that handles NPC attacking, ``` ' ///////////////////////////////////////////// ' // This is used for npcs to attack targets // ' ///////////////////////////////////////////// ``` We need to change the code that sets the target there to : ``` If Map(MapNum).Npc(x) > 0 And MapNpc(MapNum).Npc(x).Num > 0 Then Call CheckTarget(MapNum, x) 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 TryNpcAttackPlayer x, Target Else ' Player left map or game, set target to 0 Call RemoveThreat(Target, MapNum, x) 'MapNpc(MapNum).Npc(x).targetType = 0 ' clear End If Else ' lol no npc combat :( End If End If End If ``` In Public Sub SpawnNPC we need to add ``` Call ResetThreat(MapNum, MapNpcNum) ``` And after that we only need to call the add threat sub when a player damages an NPC. Below ``` ' send animation If n > 0 Then If Not overTime Then If spellnum = 0 Then Call SendAnimation(MapNum, Item(GetPlayerEquipment(attacker, Weapon)).Animation, 0, 0, TARGET_TYPE_NPC, MapNpcNum) End If End If ``` You need to change whatever there's into ``` 'Adjust the threat Call AdjustThreat(MapNum, MapNpcNum, attacker, Damage) 'If required, adjust target Call CheckTarget(MapNum, MapNpcNum) ' Set the NPC target to the player ``` And you're done. Pretty simple I guess. **EDIT** I knew I missed something. in Sub NpcAttackPlayer, change ``` ' Set NPC target to 0 MapNpc(MapNum).Npc(MapNpcNum).Target = 0 MapNpc(MapNum).Npc(MapNpcNum).targetType = 0 ```into ``` ' Set NPC target to 0 Call RemoveThreat(victim, MapNum, MapNpcNum) Call CheckTarget(Mapnum, MapNpcNum) ``` The attachment has one small error server-side, just try running it. Obvious fix is changing it into ``` Call CheckTarget(MapNum, MapNpcNum) ```
  11. If GetPlayerAccess(index) < 4 Then Exit Sub That code roughly translates into : If the player's admin access isn't sufficient, stop running this code. That's what Exit sub does. Exit sub does not move up to a previous sub or something like that. edit I misread your question ``` If GetPlayerAccess(index) < 4 Then Exit Sub Sub HandleRequestLevelUp(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) ```This is def wrong, like you say. It should look like ``` Sub HandleRequestLevelUp(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) If GetPlayerAccess(index) < 4 Then Exit Sub ```
  12. Hey, I am Joost. Some of you may know me, some may not. For those that don't, I started out working with Playerworlds maybe 8 years ago under the name of Ozzy. I don't really know, but it was before Mirage Source was out. Since then, I have worked on a variety of projects, including both games and engines. I was the lead admin for Elysium for a while, and even stuck a few lines of code in there at some point. I mapped for several different games including some of the more promising ones. I'm also a marketing student with experience promoting games/services like these. What I'm looking for is -People > 18 to work with, no kids. -A game with a GDD, game design document with some form of planning in it. That's all I guess.
  13. It is such a shame that you have been around in this community so long, creating wonderful pixel art, but never using it for a finished game.
  14. @Soul: > As for the DDoS, I don't think many have the actual capacity (control of a botnet and/or a lot of computers) to actually do that. It's more likely he'll attempt a DoS (where one computer attempts to take down a server), in which case blocking his IP will probably do the trick. I also doubt he would attempt something like that anyway. Easiest way to mess with a server is just a simple loop creating an account. A simple program can send the new account request a lot more often than the server can handle it. (Setting up the .ini or whatever is used in current versions)
  15. I enjoyed this very much. Will there be a part 2?
  16. I dont have Visual Basic to confirm, but the PvP part is probably a bit of code in the sub that handles player attacking. At that point it should be a matter of removing a few lines.
  17. http://echostorms.net/Mirage/MS%20Tutorials/Approved%20Tutorials/GFX%20Encryption%20Compression.html Old tutorial for Mirage Source, but should still be relevant. Like most others have said though, you can't stop people from ripping your work. It is impossible. And besides that, the chance that you produce a successful game is extremely extremely slim, the chance of someone making a successful game copying you is even slimmer.
  18. Completely unrelated but the only game I have ever seen properly giving arguments as to why your char is gaining experience from killing shit is KOTOR 2, where the excuse is that you slowly gain your strength from killing peoplez because you're an evil jedi. Or something like that. I dunno, I was high.
  19. Im Joost, bitches know me. I got 2 references on the front page of this site because Im a bouse.
  20. My submission, the sword of the thousand truths. There is also some important lore regarding this sword. Has something to do with dragons. ![](http://www.freemmorpgmaker.com/files/imagehost/pics/bd0e2184d329a6366b7fbc365cc03bea.png) ps: it may be a bit large but dragons are large too
×
×
  • Create New...