local skill = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(skill, CONDITION_PARAM_TICKS, 60 * 60 * 1000) -- 60 minutes setConditionParam(skill, CONDITION_PARAM_SKILL_MELEEPERCENT, 135) setConditionParam(skill, CONDITION_PARAM_SKILL_DISTANCEPERCENT, 115) setConditionParam(skill, CONDITION_PARAM_SKILL_SHIELDPERCENT, 110) local magic = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(magic, CONDITION_PARAM_TICKS, 60 * 60 * 1000) -- 60 minutes setConditionParam(magic, CONDITION_PARAM_STAT_MAGICLEVEL, 10) setConditionParam(magic, CONDITION_PARAM_SKILL_SHIELDPERCENT, -50) local function endExpRate(cid) if isPlayer(cid) then doPlayerSetRate(cid, SKILL__LEVEL, 1) doCreatureSetStorage(cid, 5751) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "The increase of the experience rate has ended.") end end function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == 11260 then doPlayerAddPremiumDays(cid, 1) doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 days of premium access.") doRemoveItem(item.uid) elseif item.itemid == 10141 then db.executeQuery('UPDATE accounts SET premium_points=premium_points+1 WHERE id='.. getPlayerAccountId(cid)) doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 shop point to your account.") doRemoveItem(item.uid) elseif item.itemid == 10140 then doAddCondition(cid, skill) doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted an increase in your offensive and defensive skills.") doRemoveItem(item.uid) elseif item.itemid == 10137 then if getCreatureStorage(cid, 5751) == -1 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted 1 hour of increased experience rate.") doPlayerSetRate(cid, SKILL__LEVEL, 2) doCreatureSetStorage(cid, 5751, os.time() + 1800) addEvent(endExpRate, 1800 * 1000, cid) doRemoveItem(item.uid) else doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have some increased experience rate time left.") end elseif item.itemid == 11261 then doAddCondition(cid, magic) doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_BLUE) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have been granted an increase in your magic skills.") doRemoveItem(item.uid) end return true end