NPC's Drop loot bags

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
943
113
Australia
Now released: NpcLoot


For server owners who would like to try out normal NPC's droping lootbags download this.

For Developers everytime an NPC is killed a .dump is created, Anyone got an idea why? :p

https://github.com/jakkee/FougeritePlugins/blob/JavaScript/Python/NpcBagDrop/NpcBagDrop.py
Python:
__title__ = 'NpcBagDrop'
__author__ = 'Jakkee'
__version__ = '1.0'

import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
import re


class NpcBagDrop:
    def On_NPCKilled(self, DamageEvent):
        #DamageEvent.Attacker.Message("victim Name: " + DamageEvent.Victim.Name)
        if DamageEvent.Victim.Name == "Stag_A" or "Bear" or "Boar_A" or "Wolf" or "Chicken_A" or "Rabbit_A":
            coords = str(DamageEvent.Victim.Character.transform.position).replace(',', ':')
            coords = self.Stringify(coords)
            coords = self.Parse(str(coords))
            coords = self.ReplaceToDot(coords[0])
            World.Spawn(";drop_lootsack_zombie", float(coords[0]) - 1.5, float(coords[1]) - 1.5, float(coords[2]))

#these below are 100% not stolen from DreTaX's AutoDoorCloser... Or are they?
    def Stringify(self, loc):
        s = re.sub("[[\]\'\ ]", '', str(loc))
        return str(s)

    def Parse(self, String):
        return String.split(',')

    def ReplaceToDot(self, String):
        str = re.sub('[(\)]', '', String)
        return str.split(':')
 
Last edited:
  • Like
Reactions: DreTaX
For server owners who would like to try out normal NPC's droping lootbags download this.

For Developers everytime an NPC is killed a .dump is created, Anyone got an idea why? :p

https://github.com/jakkee/FougeritePlugins/blob/JavaScript/Python/NpcBagDrop/NpcBagDrop.py
Python:
__title__ = 'NpcBagDrop'
__author__ = 'Jakkee'
__version__ = '1.0'

import clr
clr.AddReferenceByPartialName("Fougerite")
import Fougerite
import re


class NpcBagDrop:
    def On_NPCKilled(self, DamageEvent):
        #DamageEvent.Attacker.Message("victim Name: " + DamageEvent.Victim.Name)
        if DamageEvent.Victim.Name == "Stag_A" or "Bear" or "Boar_A" or "Wolf" or "Chicken_A" or "Rabbit_A":
            coords = str(DamageEvent.Victim.Character.transform.position).replace(',', ':')
            coords = self.Stringify(coords)
            coords = self.Parse(str(coords))
            coords = self.ReplaceToDot(coords[0])
            World.Spawn(";drop_lootsack_zombie", float(coords[0]) - 1.5, float(coords[1]) - 1.5, float(coords[2]))

#these below are 100% not stolen from DreTaX's AutoDoorCloser... Or are they?
    def Stringify(self, loc):
        s = re.sub("[[\]\'\ ]", '', str(loc))
        return str(s)

    def Parse(self, String):
        return String.split(',')

    def ReplaceToDot(self, String):
        str = re.sub('[(\)]', '', String)
        return str.split(':')
Seems like It created a dump for me too. I will put IPM up into the resources, but I will have to do some fixes, and some plugins will also need to be changed...
 
  • Informative
Reactions: Jakkee