• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Dokkio Sidebar applies AI to make browsing the web faster and more productive. Whenever you open Sidebar, you'll get an AI summary of the web page and can ask any question you like about the content of the page! Try Dokkio Sidebar for free.


Scripting Examples

This version was saved 10 years, 1 month ago View current version     Page history
Saved by James Koppel
on May 6, 2013 at 5:40:22 am

Give hero spells and skill at map start


This script will, at the start of the map, find the first hero of the first player, and give him the Fireball spell, 10 points in knowledge, 100 spellpoints, and Expert Wisdom.


Trigger(MAP_START, "", "give_stuff");

function give_stuff()
  player = GetPlayer(0);
  hero = GetHero(player, 0);

  GrantSpell(hero, SPELL_FIREBALL);
  SetPrimarySkill(hero, PRIMARY_SKILL_KNOWLEDGE, 10);
  SetSpellPoints(hero, 100);  
  SetSecondarySkill(hero, SECONDARY_SKILL_WISDOM, 3);


Give all player's heroes new troops at the start of the week


On Day 1 of every week after the first, this script will give all heroes belonging to the first player 50 skeletons, accompanied by a flavorful message.


Trigger(NEW_DAY, "", "grant_weekly_recruits");
function grant_weekly_recruits() 
  if GetDay() == 1 and not (GetWeek() == 1 and GetMonth() == 1) then
    player = GetPlayer(0);
    for i=0, GetNumHeroes(player)-1 do
      hero = GetHero(player, i);
      GrantArmy(hero, CREATURE_SKELETON, 50);
    MessageBox("More troops have risen to join our cause.");



Comments (0)

You don't have permission to comment on this page.