Page 1 of 2
increase stats (temporally) when wearing complete armor set
Posted: Mon Jun 24, 2013 5:25 pm
by bongobeat
Hi guys,
as i'm not a scripter (never)
Please can someone make me one, that give a champion some ability when he wears a complete armor set?
like that:
if champion wears: armor valor set (plate + greave + helmet + ...)
then champion gain (and only when complete armor set is wear - the bonus disappear if one of the element is removed)
strength +2
dexterity + 2
then play some sound and hubprint some text <--- but this only one time, exactly the first time when the champion wear all armor set
please, I really need this!
Re: increase stats (temporally) when wearing complete armor
Posted: Mon Jun 24, 2013 7:47 pm
by Komag
this is actually a concept I was maybe planning to implement in the next Master Quest update, but I haven't scripted anything for it yet
Re: increase stats (temporally) when wearing complete armor
Posted: Tue Jun 25, 2013 9:56 am
by bongobeat
nice!
me <--- waiting for it

Re: increase stats (temporally) when wearing complete armor
Posted: Tue Jun 25, 2013 12:11 pm
by JohnWordsworth
I'm on my iPad at the moment so can't just bash out a script right now, but one clean way of doing this would be the following. Based on the fact that I try to put as much code as possible into script entities instead of in scripts.lua as it typically crashes less...
1. Create a script_entity called 'armour_scipt', you will want 3 functions in this script.
2a. applyFullSetBonus(champ) - A function that applies the bonuses you want to apply when the full set is worn.
2b. removeFullSetBonus(champ) - The inverse of 2a, to remove the bonuses from the full item set.
2c. onEquipUnequipCheck(champ) - This function will be called directly from the onEquipItem and onUnequipItem hooks from your object definitions. It should look for the item in each of the specific item slots on the champ to see if every piece of the armour is equipped. If yes, then check check a Boolean to see if it's already equipped, if not, set that value to true and call 2a. If no, then if the afore mentioned Boolean is true, call 2b and set the bool to false.
3. For every item that is a part of the set, you will need to add hooks in the defineObject call, and write a tiny onEquipItem hook and onUnequipItem hook that simply calls 2c. armour_script.onEquipUnequipItemCheck(champion);
If you literally just need a script and this sounds too complex, I will try to write one up for you tomorrow - but I would encourage that you give it a go so that you can learn to write your own scripts in the future!
Re: increase stats (temporally) when wearing complete armor
Posted: Wed Jun 26, 2013 3:30 pm
by bongobeat
mhhh that sounds easy like that, but I expect some problem if I start to do something myself!

Re: increase stats (temporally) when wearing complete armor
Posted: Fri Jun 28, 2013 12:08 am
by undeaddemon
How does this come into play - in the game:
Code: Select all
defineObject{
armorSet = "valor",
}
Re: increase stats (temporally) when wearing complete armor
Posted: Fri Jun 28, 2013 12:13 am
by undeaddemon
I also want to use something like this - using Pandafoxs'
Black /
Golden Armour -

Re: increase stats (temporally) when wearing complete armor
Posted: Thu Jul 04, 2013 1:44 pm
by bongobeat
mhhh
never try, but.. dont think it's so easy for me!
please don't laugh
so if I read you:
this one in the editor:
Code: Select all
--script bonus_armor:
function onEquipUnequipCheck(champ)
if partyHasItem("valor_ancient") and
partyHasItem("helmet_kasrin") and
partyHasItem("inquisitor_sword")
then
function applyFullSetBonus(champ)
else
removeFullSetBonus(champ)
end
--
function removeFullSetBonus(champ)
-- ????
end
--
function applyFullSetBonus(champ)
strength = 1,
energy = 20,
hudPrint("Congratulation, you have discover the full armor of valor set, you gain 1 strength and 20 energy")
playSound("discover_spell")
end
end
and this one in the items.lua
Code: Select all
in items.lua
defineObject{
name = "valor_ancient",
armorSet = "extra",
bonus_armor.onEquipUnequipItemCheck(champion)
-- + all object definition etc…
}
defineObject{
name = "helmet_kasrin",
armorSet = "extra",
bonus_armor.onEquipUnequipItemCheck(champion)
-- + all object definition etc…
}
defineObject{
name = "inquisitor_sword",
armorSet = "extra",
bonus_armor.onEquipUnequipItemCheck(champion)
-- + all object definition etc…
}
can you be a little more precise pls? this looks like chinese for me, I m copying script from other script, that I konw how to do that, but to wrote a full new script?!
I dont know what to put in function removefullsetbonus
Code: Select all
function removeFullSetBonus(champ)
-- ????
end
Re: increase stats (temporally) when wearing complete armor
Posted: Thu Jul 04, 2013 1:49 pm
by bongobeat
undeaddemon wrote:I also want to use something like this - using Pandafoxs'
Black /
Golden Armour -

well that was not the spirit too add effect particulary on this armor set, but I use the black armor too.
do you know something about 3d models monster? I m looking for someone who can do a new monster wich wears the black armor set (skeleton anything, dont care, I only want a monster looking as a black armor). I know i ask too much!

Re: increase stats (temporally) when wearing complete armor
Posted: Thu Jul 04, 2013 9:01 pm
by undeaddemon
bongobeat wrote:undeaddemon wrote:I also want to use something like this - using Pandafoxs' Black / Golden Armour -
I m looking for someone who can do a new monster wich wears the black armor set (skeleton anything, dont care, I only want a monster looking as a black armor))
I think you are looking for this Genius -Leki -
viewtopic.php?f=14&t=5230&hilit=leki
