• 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!

SendAnimatedText if wairing full set?

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,740
Solutions
7
Reaction score
541
Location
Canada
Is it possible to use say, a global event/createevent to send an animated text every 5 seconds if the player is wairing a full set of one type of gear?

I saw an example of giving full sets buffs, but thats not what I want; and I cant edit that script down to the basics and put it on an interval since its a create script..

http://otland.net/threads/set-system.102393/

Can anyone help me out here and possibly create a script for me based off the full system given; just slim it down and turn it into a global event to do on an interval to show an animated text; not give a full buff.

Thank you very much!

@Ninja - <3 would love you if you could help with this
 
Just replace doCreatureSay with doSendAnimatedText
Code:
local t = {
    {"Lava Set", 7900, 7899, 7894, 7891},
    {"Ice Set", 7902, 7897, 7896, 7892},
    {"Energy Set", 7901, 7898, 7895, 7893},
    {"Tera Set", 7903, 7884, 7885, 7886}
}

function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
        for i = 1, #t do
            if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][2] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][3] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][4] and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == t[i][5] then
                doCreatureSay(cid, t[i][1], TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
            end
        end
    end
    return true
end
 
@Ninja,

Hey man I get this error,
Code:
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)

I think you forgot to add deequip and on equip functions or something?

Edit:
I added his deEquip and onEquip lines, but the script doesn't show the animation. (No Errors)
 
Last edited:
@Ninja,

Hey man I get this error,
Code:
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onEquip not found (data/movements/scripts/wa
r/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)
[Warning - Event::loadScript] Event onDeEquip not found (data/movements/scripts/
war/seteffects.lua)

I think you forgot to add deequip and on equip functions or something?

Edit:
I added his deEquip and onEquip lines, but the script doesn't show the animation. (No Errors)

You have to put that script on globalevents, not on movements.
 
@Cthugha - Check the link posted, its a movements script. From Ninja did, it looks like he just edited the movements script. Why do you say it should be an a global event, you can make a movement event loop, interval to have the same effect as an interval based globalevent. Atleast I think you can.
 
@Cthugha - Check the link posted, its a movements script. From Ninja did, it looks like he just edited the movements script. Why do you say it should be an a global event, you can make a movement event loop, interval to have the same effect as an interval based globalevent. Atleast I think you can.
The one from Ninja is obviously not a movement script, so how do you expect it to work with just changing onThink to onEquip/onDeEquip?
It is a globalevent as Cthugha stated, changing it into movements requires a lot more work (adding all itemids manually into movements.xml) and a lot more checks and scripting which is not neccessarily in this case, as the script he provided does the job more then enough.
 
Well @Evil Hero, I thought it was a globalevent - and tried that first; it doesn't work as a global event.. so I figured it needed to be a movements script seeing as it uses deEquip and onEquip. I'm a fricken noob okay, so don't get all offensive over me asking how I thought it would work. I don't know how it works, that's why I'm asking.

@Ninja, No error when using it as a global event, just doesn't work. Doesn't work as a Movement either!

Code:
<globalevent name="setEffect" interval="2" script="war/seteffects.lua"/>

Code:
local t = {
  {"Frozen", 7902, 7897, 7896, 8907},
  {"Golden", 2471, 2466, 7470, 2523}
}

function onThink(interval)
  for _, cid in ipairs(getPlayersOnline()) do
  for i = 1, #t do
  if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][2] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][3] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][4] and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == t[i][5] then
  doCreatureSay(cid, t[i][1], TALKTYPE_ORANGE_1)
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
  end
  end
  end
  return true
end

This is the script after I tried to edit it down to just be the 3 main armors of the set.
Code:
local t = {
  {"Frozen", 7902, 7897, 7896},
  {"Golden", 2471, 2466, 7470}
}

function onThink(interval)
  for _, cid in ipairs(getPlayersOnline()) do
  for i = 1, #t do
  if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][1] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][2] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][3] then
  doCreatureSay(cid, t[i][1], TALKTYPE_ORANGE_1)
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
  end
  end
  end
  return true
end
 
Last edited:
If it's 0.3.6 you're using now, then it's registered incorrectly in globalevents.xml
Code:
<globalevent name="setEffect" interval="2" event="script" value="war/seteffects.lua"/>
 
I didn't mean to be offensive, but neither did you said that you tried it as globalevents either.
the way you declare it in your xml file is wrong.
Code:
<globalevent name="setEffect" interval="5000" event="script" value="war/seteffects.lua"/>
 
Oh I just assumed since it didn't work as globalevent it was staying as move events, sorry for not being clear.

@Ninja, for some reason its still not working :(

Current Script:
Code:
local t = {
  {"Frozen", 7902, 7897, 7896},
  {"Golden", 2471, 2466, 7470}
}

function onThink(interval)
  for _, cid in ipairs(getPlayersOnline()) do
  for i = 1, #t do
  if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][2] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][3] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][4] then
  doCreatureSay(cid, t[i][1], TALKTYPE_ORANGE_1)
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
  end
  end
  end
  return true
end

Code:
<globalevent name="setEffect" interval="2" event="script" value="war/seteffects.lua"/>

(I have move events for the sets referred to in the script to set the deEquip and onEquip; would that interfere with this script. It shouldn't right? Since this just checks if the player has the item, and its a global event.. I assume it shouldn't matter)
 
Last edited:
I tried out Ninja's script and it works perfectly so I took liberty in adding slot's as in necklace and did my own little edit to it; that being said I was hoping to find out if there is a way I can add in shield slot and weapon slot? (either hand works)
If anyone has any idea's I'd be happy to hear them.
This is does not work.
Code:
 and getPlayerSlotItem(cid, CONST_SLOT_SHIELD).itemid == t[i][7]
Also if someone knows how to make each set get their own effect please share.
Code:
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAP)
Thank you ahead of time!!
~Sin
 
Last edited:
I tried out Ninja's script and it works perfectly so I took liberty in adding slot's as in necklace and did my own little edit to it; that being said I was hoping to find out if there is a way I can add in shield slot and weapon slot? (either hand works)
If anyone has any idea's I'd be happy to hear them.
This is does not work.
Code:
 and getPlayerSlotItem(cid, CONST_SLOT_SHIELD).itemid == t[i][7]
Also if someone knows how to make each set get their own effect please share.
Code:
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAP)
Thank you ahead of time!!
~Sin

use CONST_SLOT_RIGHT or CONST_SLOT_LEFT
 
Alright it works perfectly thank you @Cthugha, I for some reason couldn't think of "RIGHT/LEFT" I was thinking "RIGHTHAND/LEFTHAND" lol been awhile for a while trying to get back into it; Thank You!
@Extrodus This is Ninja's (mine's a lot longer due to what I added)
globalevents.xml: (You Can name the lua whatever you please)
Code:
    <globalevent name="setEffect" interval="8" script="setsystem.lua"/>

Inside globalevents/scripts/setsystem.lua: (You Can name the lua whatever you please)
Code:
local t = {
    {"Fire", 7900, 7899, 7894, 7891},
    {"Ice", 7902, 7897, 7896, 7892}
}

function onThink(interval)
  for _, cid in ipairs(getPlayersOnline()) do
  for i = 1, #t do
  if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][2] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][3] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][4] and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == t[i][5] then
  doCreatureSay(cid, t[i][1], TALKTYPE_ORANGE_1)
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
  end
  end
  end
  return true
end
Now only thing to figure out is how to make each set have it's own effect
Code:
  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
~Sin
 
Last edited:
Code:
local t = {
    {"Fire", CONST_ME_GIFT_WRAPS, 7900, 7899, 7894, 7891},
    {"Ice", CONST_ME_MAGIC_GREEN, 7902, 7897, 7896, 7892}
}

function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
        for i = 1, #t do
            if getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[i][3] and getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == t[i][4] and getPlayerSlotItem(cid, CONST_SLOT_LEGS).itemid == t[i][5] and getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid == t[i][6] then
                doCreatureSay(cid, t[i][1], TALKTYPE_ORANGE_1)
                doSendMagicEffect(getCreaturePosition(cid), t[i][2])
            end
        end
    end
    return true
end
 
Last edited:
@Ninja, thank you; I figured it out with your new update to give each set its own effect.

How do I change the text color; everytime I change it to say YELLOW or TEXTCOLOR_YELLOW it debugs the client.

Also I can't use symbols like † in the script to give cool symbols for each set, anyone know how to add this?
 
Out of curiosity @Ninja would you know how to make this script work only if they have a certain promotion? (Third Promotion)

~Sin
if getPlayerPromotionLevel(cid) == 3 and getPlayerSlotItem(cid, CONST_SLOT_HEAD).itemid == t[3]
 
Back
Top