package activity

import (
	"fmt"
	activityCfg "server/conf/activity"
	"server/game/mod/item"
	GoUtil "server/game_util"
)

// 活动礼包
func (a *Activity) Fire(Id int) ([]*item.Item, error) {
	AId := activityCfg.GetActivityGiftId(Id)
	Var := a.getGiftVar(AId)
	if Var.Buy {
		return nil, fmt.Errorf("Id%d已购买", Id)
	}
	Var.Buy = true
	Var.Time = GoUtil.Now()
	return activityCfg.GetActivityGiftItems(Id), nil
}
