Hello nice people,
I'm trying to adapt the Premium system to affectshower, but I'm running into a problem.
On client side I have declared the 'NEW_PREMIUM_AFFECT' under ID 981 in InstanceBase.h(Same in PythonCharacterModule.cpp). I also have this same affect on the server side in affect.h.
However, the problem occurs when I try to call affect.add_*, which I have in quest:
Code
- quest premium_ticket begin
- state start begin
- when 95002.use begin
- if pc.is_premium2() then
- syschat("Owned")
- return
- end
- local vnum = item.get_vnum()
- local days = 1
- pc.set_premium(days)
- local affect_type = NEW_PREMIUM_AFFECT
- local affect_value = 1
- local affect_duration = 60 * 60 * 24 * days
- affect.add(affect_type,affect_value, affect_duration)
- affect.add_collect(981, 0, affect_duration)
- affect.add_collect_point(affect_type, affect_value, affect_duration)
- syschat("Activated for " .. days .. " days.")
- pc.remove_item(vnum)
- pc.refresh_premium()
- return
- end -- when
- end -- state
- end -- quest
I saw some post about these affect.add being problematic, but I tried changing it a bit and nothing works for me.
Also tried to find the ID of this affect but there isn't already made function for it
I can't figure out why this affect is not added and I don't know how to deal with it Could someone please point me to the right way?
Thank you and have a nice rest of the day