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

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Scripting Examples

This version was saved 10 years, 10 months ago View current version     Page history
Saved by James Koppel
on May 6, 2013 at 5:39:49 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);
end

 

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);

end;

 

MessageBox("More troops have risen to join our cause.");

  end;

end;

 

 

Comments (0)

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