xexam
New Member
- Joined
- Aug 3, 2010
- Messages
- 172
- Reaction score
- 2
Hello!
I've got a problem with transform ring script.
this is how i configured it, seems to be ok, actually it works, but:
1. It doesnt take any money from the player when using the ring (just 100cc once when the ring is on, thats all)
2. It keeps spamming messages like "13:06 Coins left: 84!" very fast! how to make a for example 10 sec delay between the low-coin-amount warnings? Thanks in advantage
3. When the ring is on - IT WORKS, but when i logout and login the ring is on, but it doesnt work (im not a demon outfited) why is that? How can i fix it - i want the ring to work when player relog without need of re-putting it in ring place
4. It keeps spamming the 'magical effect' , it seems to be no delay between the effects and it looks annyoing - how to add delay to this appearing 'magical effects'?
Cheers!
I've got a problem with transform ring script.
Code:
local outfit =
{
-- Girls
{
lookType = 12,
lookHead = 19,
lookBody = 53,
lookLegs = 92,
lookFeet = 79,
lookAddons = 0
},
-- Boys
{
lookType = 12,
lookHead = 19,
lookBody = 79,
lookLegs = 3,
lookFeet = 81,
lookAddons = 0
}
}
local coinID = ITEM_CRYSTAL_COIN
local wastingInterval = 300
local wastingQuantity = 1
local triggerQuantity = 100
local warnOnLowSupply = TRUE
local lowSupplyMargin = 100
local storage = 50780
-- Config << --
local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition1, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FIST, 120)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 120)
setConditionParam(condition1, CONDITION_PARAM_SKILL_CLUB, 120)
setConditionParam(condition1, CONDITION_PARAM_SKILL_SWORD, 120)
setConditionParam(condition1, CONDITION_PARAM_SKILL_AXE, 120)
setConditionParam(condition1, CONDITION_PARAM_SKILL_DISTANCE, 120)
setConditionParam(condition1, CONDITION_PARAM_SKILL_SHIELD, 120)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING, 120)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAGICPOINTS, 120)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 180)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 180)
local condition2 = createConditionObject(CONDITION_HASTE)
setConditionParam(condition2, CONDITION_PARAM_TICKS, -1)
setConditionFormula(condition2, 2.5, 0, 3.0, 0)
local area = createCombatArea({
{0, 0, 0, 1, 0, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 0, 0, 0, 0, 0},
{1, 0, 0, 2, 0, 0, 1},
{0, 0, 0, 0, 0, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 0, 1, 0, 0, 0}
})
local animCombat =
{
createCombatObject(),
createCombatObject()
}
local sexyEffect =
{
CONST_ME_FIREWORK_RED,
CONST_ME_FIREWORK_YELLOW,
CONST_ME_MAGIC_RED,
CONST_ME_MAGIC_GREEN
}
setCombatParam(animCombat[2], COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
setCombatParam(animCombat[2], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
setCombatParam(animCombat[1], COMBAT_PARAM_EFFECT, CONST_ME_FIREWORK_RED)
setCombatParam(animCombat[1], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatArea(animCombat[2], area)
setCombatArea(animCombat[1], area)
local function StopSuperForm(cid)
if (getPlayerStorageValue(cid, storage) == 1) then
setPlayerStorageValue(cid, storage, 0)
doRemoveCondition(cid, CONDITION_OUTFIT)
doRemoveCondition(cid, CONDITION_ATTRIBUTES)
doRemoveCondition(cid, CONDITION_HASTE)
end
return TRUE
end
local function SuperForm(cid, sexIndex)
if (isCreature(cid)) then
if (getPlayerStorageValue(cid, storage) == 1) then
local goldLeft = getPlayerItemCount(cid, coinID)
if (goldLeft >= wastingQuantity) then
local position = getCreaturePosition(cid)
doSendMagicEffect(position, sexyEffect[sexIndex + 2])
doSendMagicEffect(position, sexyEffect[sexIndex])
if (goldLeft <= lowSupplyMargin and warnOnLowSupply == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Coins left: " ..(goldLeft - wastingQuantity) .. "!")
end
addEvent(SuperForm, wastingInterval, cid, sexIndex)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your bangle has been destroyed!")
doPlayerRemoveItem(cid, 2127, 1)
return StopSuperForm(cid)
end
end
end
end
function onEquip(cid, item, slot)
if (getPlayerItemCount(cid, coinID) > triggerQuantity and getPlayerStorageValue(cid, storage) ~= 1) then
local sexIndex = getPlayerSex(cid) + 1
doCombat(cid, animCombat[sexIndex], numberToVariant(cid))
doSetCreatureOutfit(cid, outfit[sexIndex], -1)
setPlayerStorageValue(cid, storage, 1)
doAddCondition(cid, condition1)
doAddCondition(cid, condition2)
doPlayerRemoveItem(cid, coinID, triggerQuantity)
SuperForm(cid, sexIndex)
elseif (getPlayerStorageValue(cid, storage) == 1) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You cannot equip this now!")
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You do not have enough coins!")
end
return TRUE
end
function onDeEquip(cid, item, slot)
return StopSuperForm(cid)
end
this is how i configured it, seems to be ok, actually it works, but:
1. It doesnt take any money from the player when using the ring (just 100cc once when the ring is on, thats all)
2. It keeps spamming messages like "13:06 Coins left: 84!" very fast! how to make a for example 10 sec delay between the low-coin-amount warnings? Thanks in advantage
3. When the ring is on - IT WORKS, but when i logout and login the ring is on, but it doesnt work (im not a demon outfited) why is that? How can i fix it - i want the ring to work when player relog without need of re-putting it in ring place
4. It keeps spamming the 'magical effect' , it seems to be no delay between the effects and it looks annyoing - how to add delay to this appearing 'magical effects'?
Cheers!