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

How can i make it so you can only kill a monster once?


Waffle
 Share

Recommended Posts

I want to make a monster you can only kill once, then you get a message like "You have no reason to kill ."

is this possible without scripting?

maybe no message… but are you able to make it so a monster can only be killed once?
Link to comment
Share on other sites

@Admiral:

> Without scripting?
> Not possible.
>
> With scripting?
> VERY easy, maybe 4 lines of code, max.

This, I would love to see.

only way I can think of is creating two identical maps where one is a friendly npc and one isn't.
Link to comment
Share on other sites

@«umbra»:

> This, I would love to see.
>
> only way I can think of is creating two identical maps where one is a friendly npc and one isn't.

In the sub, OnNpcDeath (or whatever it's called)
```
If NPCNum = 5 Then
  Call PutVar("NpcOnlyOnce.ini", NPCNum & "", "Attacked", "1")
End If
```
In the sub OnAttack, under "Target = GetPlayerTargetNpc(Index)", put:
```
If GetMapNpcNumber(GetPlayerMap(Index), Target) = 5 Then
  If GetVar("NpcOnlyOnce.ini", NPCNum & "", "Attacked") <> "" Then
      Call PlayerMsg(Index, "You have no reason to kill " & Trim(GetNpcName(5)), RED)
  End If
End If
```

Haven't tested this, but it will probably work.
NOTE: Change "5" to the NPC's number you only want to kill once.
Link to comment
Share on other sites

@Admiral:

> In the sub, OnNpcDeath (or whatever it's called)
> ```
> If NPCNum = 5 Then
>   Call PutVar("NpcOnlyOnce.ini", NPCNum & "", "Attacked", "1")
> End If
> ```
> In the sub OnAttack, under "Target = GetPlayerTargetNpc(Index)", put:
> ```
> If GetMapNpcNumber(GetPlayerMap(Index), Target) = 5 Then
>   If GetVar("NpcOnlyOnce.ini", NPCNum & "", "Attacked") <> "" Then
>       Call PlayerMsg(Index, "You have no reason to kill " & Trim(GetNpcName(5)), RED)
>   End If
> End If
> ```
> That only shows a message, he wants you to be able to only kill it once.
>
> Haven't tested this, but it will probably work.
> NOTE: Change "5" to the NPC's number you only want to kill once.
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...