• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem ] 0.3.6 Players cant attack eachother if they both use chaosbangle rep++

Dalale

GX
Joined
Jun 13, 2008
Messages
718
Reaction score
2
Location
Sweden
Hello.

I got this problem, when 2 people use this Transform ring they cant attack eachother, the error says "You cant attack a teammate"
I dont know what the problem can be, anyone have a idea?


Config.lua

Code:
	allowChangeOutfit = true
	allowChangeColors = true
	allowChangeAddons = true
 
Change in config from noDamageToSameLookfeet = true

to

noDamageToSameLookfeet = false

Or post the script and i will check on it!
 
Change in config from noDamageToSameLookfeet = true

to

noDamageToSameLookfeet = false

Or post the script and i will check on it!

I already had that in config
noDamageToSameLookfeet = false

Code:
local outfit =
{
    -- Girls
    {
        lookType   = 12,
        lookHead   = 19,
        lookBody   = 53,
        lookLegs   = 92,
        lookFeet   = 79,
        lookAddons = 0
    },
    -- Boys
    {
        lookType   = 12,
        lookHead   = 12,
        lookBody   = 30,
        lookLegs   = 135,
        lookFeet   = 50,
        lookAddons = 0
    }
}
 
local coinID          = 2160
local wastingInterval = 1000
local wastingQuantity = 1
local triggerQuantity = 5
local warnOnLowSupply = TRUE
local lowSupplyMargin = 200
local storage         = 50780
 
-- Config << --
 
local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition1, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FIST,                65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING,             65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_CLUB,                65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_SWORD,               65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_AXE,                 65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_DISTANCE,            65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_SHIELD,              65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING,             65)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAGICPOINTS,          65)


 
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, 0, 0, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 0, 1, 0, 0},
    {0, 1, 0, 2, 0, 1, 0},
    {0, 0, 1, 0, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0}
})
 
local animCombat = 
{
    createCombatObject(),
    createCombatObject()
}
 
local sexyEffect =
{
    CONST_ME_MAGIC_GREEN,
    CONST_ME_MAGIC_RED,
    CONST_ME_MAGIC_RED,
    CONST_ME_MAGIC_GREEN
}
 
setCombatParam(animCombat[2], COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatParam(animCombat[2], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
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)
                doPlayerRemoveItem(cid, coinID, wastingQuantity)
                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
                                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




I wouldnt recommend helping this whiny brat
well, the one who should be mad should be me, not you, you lured me!
 
still got the problem with the bangle...

I also would like to ask the scripters for help.. about my tp scroll
I would like you to add exahust and effect + timer, it would be perfect!
Code:
--Script by Sonical
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
if not inFight then
      doSendMagicEffect(getPlayerPosition(cid), 2)
      doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
      doSendMagicEffect(newpos,10)
	  doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid,25,"You could not use this teleport scroll if you are in fight!")
end
return 1
end
 
Code:
function countDown(number, pos, effect, msgonend, effectonend)
  local n = number
       for i = 1, number do
           addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
		   addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )

              n = n -1
	   end
      n = number
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
 if isPlayerPzLocked(cid) then
    doPlayerSendCancel(cid,"You Cannot Teleport Right After A Battle!.")
 else
    countDown(10, getThingPos(cid), 5, "Warped!", 2)
	doCreatureSetNoMove(cid, 1)
	addEvent(doTeleportThing,10000,cid,getTownTemplePosition(getPlayerTown(cid)),FALSE)
	addEvent(doCreatureSetNoMove,10000,cid, 0) 
	addEvent(doSendMagicEffect,10004,getTownTemplePosition(getPlayerTown(cid)), 10) 
  end
return true
end
i Take 0 Credit for this
All the credit of this script goes to Sonik of otland =)
But if i helped Please rep me ++ =) thanks!

Or maybe a shortened version? Not sure if this has cooldown only when ur in battle effect...
Code:
function onUse(cid, item, frompos, item2, topos)
ppos = getPlayerPosition(cid)
temple = getPlayerMasterPos(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(ppos,66)
doSendAnimatedText(frompos,'Wiee!',16)
else
doPlayerSendCancel(cid,"You can't teleport immediately after fight.")
doSendMagicEffect(ppos,2)
end
return 1
end
Credit of this one go's to _Arthur
 
Added rep++ to you Undefeatable

Ive fixeded exahust + storage at the first tp scroll, because players was spamming it and the effects was spammed


Its not my script, but i edited it
Code:
local cfg = {
	exhausted = 60, -- Time you are exhausted.
	storage = 1447, -- Storage used for "exhaust."
}

function countDown(number, pos, effect, msgonend, effectonend)
  local n = number
       for i = 1, number do
           addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
		   addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )

              n = n -1
	   end
      n = number
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
 if isPlayerPzLocked(cid) then
    doPlayerSendCancel(cid,"You Cannot Teleport Right After A Battle!.")
 else
 if(getPlayerStorageValue(cid, cfg.storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, cfg.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, cfg.storage) - os.time()) == 1 and "" or "s") .. " to use the teleport.")
		elseif(getTilePzInfo(getCreaturePosition(cid)) == true) then
		else
    countDown(5, getThingPos(cid), 8, "Warped!", 2)
	doCreatureSetNoMove(cid, 1)
	addEvent(doTeleportThing,5000,cid,getTownTemplePosition(getPlayerTown(cid)),FALSE)
	addEvent(doCreatureSetNoMove,5000,cid, 0) 
	addEvent(doSendMagicEffect,10004,getTownTemplePosition(getPlayerTown(cid)), 10) 
	setPlayerStorageValue(cid, cfg.storage, os.time() + cfg.exhausted)
  end
return true
end
end


Still somone who can help me with this bangle problem?


Edit: Bangle situation, I dont know how the first bug got fixed, but now its working to attack eachother if both of players use the bangle, But I want it to add 20% more hp and mana, but i tried to change in items.xml with no sucess

Code:
	<item id="2127" article="an" name="emerald bangle">
		<attribute key="weight" value="170"/>
		<attribute key="ring" value="20"/>
		<attribute key="healthGain" value="50"/>
		<attribute key="healthTicks" value="50"/>
		<attribute key="maxManaPointsPercent" value="122"/>
		<attribute key="maxHitPointsPercent" value="122"/>
		<attribute key="slotType" value="ring"/>
	</item>

I think to make it work it need to be added in the script, any ideas?:rolleyes:
 
Last edited:
Well the best way is to add like this

Lua:
	setConditionParam(condition, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 10)
	setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 10)
	doAddCondition(cid, condition)
	doRemoveCondition(cid, CONDITION_ATTRIBUTES)

With those functions its gonna work remeber that the "10" means 0% more, 110% means 10% more hp, mana, ect.
 
Well the best way is to add like this

Lua:
	setConditionParam(condition, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 10)
	setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 10)
	doAddCondition(cid, condition)
	doRemoveCondition(cid, CONDITION_ATTRIBUTES)

With those functions its gonna work remeber that the "10" means 0% more, 110% means 10% more hp, mana, ect.

hello thanks for your post but it didnt work :s , but i managed to fix hp/mana thing but still look at prob V

Edit: Still players with bangle cant attack eachother, because their are same colours, Ill show you in a pic
23wv8nq.jpg


Code:
-- Config << --
 
local condition1 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition1, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FIST,                65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING,             65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_CLUB,                65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_SWORD,               65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_AXE,                 65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_DISTANCE,            65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_SHIELD,              65)
setConditionParam(condition1, CONDITION_PARAM_SKILL_FISHING,             65)
setConditionParam(condition1, CONDITION_PARAM_STAT_MAGICPOINTS,          65)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 120)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 120)
 
Last edited:
It cant be the script, There is nothing in there that can do effect on the attack creature, Try using another .exe or even try looking over the players, might be smth wrong with another custom script, might not just be this script.
 
Back
Top