mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-08-02 03:15:52 -04:00
- The duration needed to be set on the buff object "before "the buff is actually added. Because of this, I made the distinction between setup(0 (setting up the buff object) and add() (adding the buff stats to the player). - Group buffs would add the buff based on each individual player's skillmods instead of the buffer's. Due to this, I made a "buffer" parameter for doAddBuff(). If there is a buffer, regardless of it's a buffer within our group, we can specify them, otherwise provide null.
26 lines
681 B
Python
26 lines
681 B
Python
from resources.common import BuffBuilder
|
|
import sys
|
|
|
|
def setup(core, actor, buff):
|
|
return
|
|
|
|
def add(core, actor, buff):
|
|
|
|
buffWorkshop = actor.getAttachment('buffWorkshop')
|
|
|
|
if buffWorkshop is None:
|
|
return
|
|
|
|
buff.setDuration(3600) #1 hour
|
|
|
|
for BuffItem in buffWorkshop:
|
|
core.skillModService.addSkillMod(actor, BuffItem.getSkillName(), BuffItem.getAffectAmount())
|
|
|
|
return
|
|
|
|
def remove(core, actor, buff):
|
|
for BuffItem in actor.getAttachment('buffWorkshop'):
|
|
core.skillModService.deductSkillMod(actor, BuffItem.getSkillName(), BuffItem.getAffectAmount())
|
|
|
|
actor.setAttachment('buffWorkshop', 'none')
|
|
return |