Eduardo Mattos
New Member
- Joined
- Apr 25, 2016
- Messages
- 2
- Reaction score
- 1
Hello guys,
I'm implementing a new feature on a Canary server and i have some questions (i'm kinda new to ot's sources development), i'm trying to add a new attribute to monsters called warFaction, i configured it in creatures in the sources (because players will also have this warFaction attribute), i already made getFaction and setFaction work fine in lua files but the problem is that i dont know how to make a monster have this warFaction by default (write it in the monster_name.lua file and the monster spawns with the warFaction set), i'll write below the code i would like to use to make it more clear to understand:
If someone can help me to understand how this code would translate in the sources i would appreciate it, thank you!
I'm implementing a new feature on a Canary server and i have some questions (i'm kinda new to ot's sources development), i'm trying to add a new attribute to monsters called warFaction, i configured it in creatures in the sources (because players will also have this warFaction attribute), i already made getFaction and setFaction work fine in lua files but the problem is that i dont know how to make a monster have this warFaction by default (write it in the monster_name.lua file and the monster spawns with the warFaction set), i'll write below the code i would like to use to make it more clear to understand:
Lua:
local mType = Game.createMonsterType("Faction Tester")
local monster = {}
monster.description = "a faction tester"
monster.experience = 6000
monster.outfit = {
lookType = 35,
lookHead = 0,
lookBody = 0,
lookLegs = 0,
lookFeet = 0,
lookAddons = 0,
lookMount = 0,
}
monster.warFaction = 2 -- this line here is what i need to know how i make it work in the sorces so that monsters can spawn with the faction already set
If someone can help me to understand how this code would translate in the sources i would appreciate it, thank you!