View Single Post
  #1  
Old 01-03-2009, 01:09 PM
The Rider The Rider is offline
Approved Member
 
Join Date: Jun 2008
Posts: 76
Default Random rune after a battle

Hi all,
I was trying to change the existing mod that gives mana or rage potion after a battle. My idea was to give with a small chance depending on the hero skill trophies a random rune. I tried two variants of that without success.
that was the old code:
Code:
 if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("alchemist"))*10) then
    Logic.hero_add_item("mana_potion")
  end
I first changed it to that, since the runes are considered items in the game:
Code:
 if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("charm"))*5) then
    Logic.hero_add_item("rune_might")
  end
than I tried that, following the logic from the level up of the hero:
Code:
if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("charm"))*5) then
    Logic.hero_add_item(1,"rune_might",might)
  end
but nothing happens...
any ideas?
Reply With Quote