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

Mob Killing?


crzyone9584
 Share

Recommended Posts

I've been looking at a few quest scripts and source edits to see how they manage to count how many mobs you have killed. They are all through the OnNPCDeath sub. That would require me to add a new If statement every-time I have a new quest and that means server downtime to update the server. Is there any other way of checking and inserting mob kills in [EO]?
Link to comment
Share on other sites

For Origins I'd personally create a centralised quest flag system and universal handler for the same quest types.

I'd have a loop to go through all the quests in the PlayerAttackNpc procedure (the bit where they're killed) and have it change the quest flag accordingly if the quest is the type where you need an npc kill count.
Link to comment
Share on other sites

With that method should I make an ini file? I was adding the info to the npc. How I'm understanding it I'd have it loop through all the files for the players that are in the quest folder, see if the quest status is set to 1 for active then update the the number of npc killed from that loop? Did i understand you correctly robin?
Link to comment
Share on other sites

Ah ok, I'm able to store things in the PlayerRec. If i stored it there wouldn't it limit it to 1 quest at a time? Or is there a way to hold details on multiple types of quests using just something defined like this under the player rec?

```
QuestNum as Long ' number of the quest
QuestName as String ' name of the quest
KillNPCNum as Long ' number of npc you need to kill
NpcKills as Long ' how many times you need to kill it
```
Again thanks for the help.
Link to comment
Share on other sites

Okay so here is the Quest UDT

So far here is what I've added. I hope its correct so far.

In modConstants I've added this under the comment general constants
```
Public Const MAX_QUEST As Byte = 100
```
At the top of modTypes I've added
```
Public Quest(1 To MAX_QUESTS) As QuestRec
```
Here is the QuestRec code
```
Private Type QuestRec
    QuestNPCnum As Long ' number of npc code will check to see if they have a quest attached to them
    PlayerLevel As Byte ' required level the player has to be for them to be able to accept the quest
    QuestName As String ' quest name
    TalkToNPCNum As Long ' How many NPCs a user must talk to
    FinishMsg As String * 250 'last message the npc will say after you complete the quest
    RewardExp As Long ' how much exp a player will get after completion
    QuestStartSay As String * 250 ' what the starting npc will say to start the quest
    RecItem1 As Long ' 1st required item
    RecItem1Amt As Long ' how many you need of the 1st item
    RecItem2 As Long ' 2nd required item
    RecItem2Amt As Long 'how many you need of the 2nd item
    RecItem3 As Long ' 3rd required item
    RecItem3Amt As Long ' how many you need of the 3rd item
    TalkNpc1 As Long ' number of npc you need to talk to
    TalkNpc1Say As String * 250 ' what they will say
    TalkNpc2 As Long ' number of the 2nd npc you need to talk to
    TalkNpc2Say As String * 250 ' what 2nd npc will say
    TalkNpc3 As Long ' number of the 3rd npc you need to talk to
    TalkNpcSay3 As String * 250 ' what the 3rd npc will say
    SlayNpc1 As Long ' number of the 1st monster you want them to slay
    SlayNpc1Amt As Long ' how many of the 1st monster you want them to slay
    SlayNpc2 As Long ' number of the 2nd monster you want them to slay
    SlayNpc2Amt As Long ' how many of the 2nd monster you want them to slay
    SlayNpc3 As Long ' number of npc of the 3rd monster you want them to slay
    SlayNpc3Amt As Long ' how many of the 3rd monster you want them to slay
    Reward1 As Long ' what the user gets after quest is completed.
    RewardAmt As Long ' how many of that item
    Reward2 As Long  'what the user gets after quest is completed.
    Reward2Amt As Long ' how many of that item
    Reward3 As Long  'what the user gets after quest is completed.
    Reward3Amt As Long ' how many of that item
End Type

```
I'm hoping I'm doing this correctly. I'm still working on the array to add to the users UDT. Reading up on arrays. They don't seem to be that hard.
Link to comment
Share on other sites

ohh
playerRec

I never tought that and even know wtf is UDT
good luck crazyone  :icon_music:

–-------
~~dont work here  ;D

I set Up NpcToKill to 20 and playermsg
the msg show 20

after that the NpcToKill comeback to 0

I need send to the client and comeback x_x~~

work now

you will need add the new thing on PlayerData >.>
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...