#define CW_SET_VARIABLES [variables] [Player] [1] SpawnX=11 SpawnY=10 DeathX=4 DeathY=2 [/1] [2] SpawnX=25 SpawnY=10 DeathX=26 DeathY=2 [/2] [3] SpawnX=11 SpawnY=11 DeathX=6 DeathY=2 [/3] [4] SpawnX=1 SpawnY=1 DeathX=1 DeathY=1 [/4] [5] SpawnX=25 SpawnY=11 DeathX=28 DeathY=2 [/5] [6] SpawnX=11 SpawnY=9 DeathX=8 DeathY=2 [/6] [7] SpawnX=25 SpawnY=9 DeathX=30 DeathY=2 [/7] [8] SpawnX=1 SpawnY=1 DeathX=1 DeathY=1 [/8] [/Player] [Creep] [1] id=Peasant [/1] [1] id=Goblin Spearman [/1] [2] id=Giant Mudcrawler [/2] [2] id=Elvish Shaman [/2] [2] id=Poacher [/2] [3] id=Bone Shooter [/3] [3] id=Javelineer [/3] [4] id=Outlaw [/4] [4] id=Trapper [/4] [4] id=Goblin Pillager [/4] [5] id=Giant Spider [/5] [5] id=Orcish Slayer [/5] [6] id=Elvish Avenger [/6] [6] id=Drake Blademaster [/6] [6] id=Assassin [/6] [7] id=Great Mage [/7] [7] id=Elvish Sylph [/7] [7] id=Grand Marshal [/7] [8] id=Fire Dragon [/8] [8] id=Ancient Lich [/8] [8] id=Yeti [/8] [/Creep] [/variables] #enddef #define CW_CREATE_TEAM_LEADERS {CREATE_UNIT 4 (CW_Leader) 32 10 () ()} {CREATE_UNIT 8 (CW_Leader) 4 10 () ()} #enddef #define CW_CREATE_TEAM_GUARDS {CREATE_UNIT 4 (CW_Guard) 26 6 () ()} {CREATE_UNIT 4 (CW_Guard) 26 14 () ()} {CREATE_UNIT 8 (CW_Guard) 10 6 () ()} {CREATE_UNIT 8 (CW_Guard) 10 14 () ()} #enddef #define CW_REVIVE_HEROES {ON_SIDETURN ( {MODIFY_VARIABLE DeathX format $Player.$side_number|.DeathX} {MODIFY_VARIABLE DeathY format $Player.$side_number|.DeathY} {MODIFY_VARIABLE SpawnX format $Player.$side_number|.SpawnX} {MODIFY_VARIABLE SpawnY format $Player.$side_number|.SpawnY} {IF ( [have_unit] x=$DeathX y=$DeathY [/have_unit] ) ( {TELEPORT_UNIT ( side=$side_number canrecruit=1 ) $SpawnX $SpawnY} )} )} #enddef #define CW_WHEN_HEROES_DIE {CW_WHEN_HERO_DIE 1 1 2 2 5 7} {CW_WHEN_HERO_DIE 3 1 2 2 5 7} {CW_WHEN_HERO_DIE 6 1 2 2 5 7} {CW_WHEN_HERO_DIE 2 2 1 1 3 6} {CW_WHEN_HERO_DIE 5 2 1 1 3 6} {CW_WHEN_HERO_DIE 7 2 1 1 3 6} #enddef #define CW_WHEN_CREEPS_DIE {CW_WHEN_CREEP_DIE 8 2 2 5 7} {CW_WHEN_CREEP_DIE 4 1 1 3 6} #enddef #define CW_WHEN_LEADERS_DIE {CW_WHEN_LEADER_DIE 8 1 3 6} {CW_WHEN_LEADER_DIE 4 2 5 7} #enddef #define CW_WHEN_GUARDS_DIE {CW_WHEN_GUARD_DIE 8 2 5 7} {CW_WHEN_GUARD_DIE 4 1 3 6} #enddef #define CW_SPAWN_CREEPS {CW_SPAWN_CREEP 4 2 26 6} {CW_SPAWN_CREEP 4 2 26 14} {CW_SPAWN_CREEP 8 1 10 6} {CW_SPAWN_CREEP 8 1 10 14} #enddef #define CW_WHEN_HERO_DIE SIDE ALLYTEAM ENEMYTEAM ENEMY1 ENEMY2 ENEMY3 {ON_DEATH ( side={SIDE} canrecruit=1 ) ( {OBJECT ( {MODIFY_STATUS remove poisoned} {RESTORE_HEALTH_FULL} {MODIFY_HITPOINTS 0 -50%} {MODIFY_HITPOINTS 0 100%} )} {TELEPORT_UNIT ( side={SIDE} canrecruit=1 ) $Player.{SIDE}.DeathX $Player.{SIDE}.DeathY} {MODIFY_VARIABLE Team.{ENEMYTEAM}.Kills add 1} {ADD_GOLD {ENEMY1} 50} {ADD_GOLD {ENEMY2} 50} {ADD_GOLD {ENEMY3} 50} )} #enddef #define CW_WHEN_CREEP_DIE SIDE ENEMYTEAM ENEMY1 ENEMY2 ENEMY3 {ON_DEATH ( side={SIDE} {NOT (type=CW_Guard)} {NOT (type=CW_Leader)} ) ( {MODIFY_VARIABLE Team.{ENEMYTEAM}.Kills add 1} {ADD_GOLD {ENEMY1} 5} {ADD_GOLD {ENEMY2} 5} {ADD_GOLD {ENEMY3} 5} )} #enddef #define CW_WHEN_GUARD_DIE SIDE ENEMY1 ENEMY2 ENEMY3 {ON_DEATH ( side={SIDE} type=CW_Guard ) ( {ADD_GOLD {ENEMY1} 250} {ADD_GOLD {ENEMY2} 250} {ADD_GOLD {ENEMY3} 250} )} #enddef #define CW_WHEN_LEADER_DIE SIDE ALLY1 ALLY2 ALLY3 {ON_DEATH ( side={SIDE} type=CW_Leader ) ( [kill] side={SIDE} animate=yes fire_event=no [/kill] [kill] side={ALLY1} animate=yes fire_event=no [/kill] [kill] side={ALLY2} animate=yes fire_event=no [/kill] [kill] side={ALLY3} animate=yes fire_event=no [/kill] )} #enddef #define CW_SPAWN_ID TEAM {MODIFY_VARIABLE SpawnLevel value 0} {MODIFY_VARIABLE SpawnLevel format $Team.{TEAM}.Kills} {MODIFY_VARIABLE SpawnLevel divide 8} {MODIFY_VARIABLE SpawnLevel add 1} {IF_VARIABLE SpawnLevel greater_than 8 ( {MODIFY_VARIABLE SpawnLevel value 8} )} {MODIFY_VARIABLE Rand_List format "0..$Creep.$SpawnLevel|.length"} {MESSAGE narrator () () "Creep.$SpawnLevel|.length = $Creep.$SpawnLevel|.length"} {MESSAGE narrator () () "$Creep"} [set_variable] name=random random=$Rand_List [/set_variable] {MODIFY_VARIABLE Spawn_ID to_variable Creep.$SpawnLevel|[$random].id} #enddef #define CW_AI_AVOIDS [avoid] x=8,8,14,14,22,22,28,28 y=9,11,8,12,8,12,9,11 [/avoid] #enddef #define CW_SET_LABELS {SET_LABEL_PERSISTANT 4 10 (_ "Team Leader")} {SET_LABEL_PERSISTANT 32 10 (_ "Team Leader")} {SET_LABEL_PERSISTANT 10 6 (_ "Guard")} {SET_LABEL_PERSISTANT 10 14 (_ "Guard")} {SET_LABEL_PERSISTANT 26 6 (_ "Guard")} {SET_LABEL_PERSISTANT 26 14 (_ "Guard")} {SET_LABEL_PERSISTANT 18 7 (_ "Oasis")} {SET_LABEL_PERSISTANT 18 13 (_ "Oasis")} #enddef #define CW_SET_INFO_SIGNS {SET_IMAGE_AND_LABEL_PERSISTANT 10 10 (items/signpost.png) (_ "Information")} {ON_TILE 10 10 () ( {MENU_PERSISTANT () () (_ "Welcome to Creep Wars! If you are new to Creep War you should start with reading the introduction. For a deeper understanding, read the rules. There is also a changelog and a balances list. Have a nice game!") ( {MENU_OPTION (Introduction) ({CW_INTRODUCTION})} {MENU_OPTION (Game Rules) ({CW_GAME_RULES})} )} )} {SET_IMAGE_AND_LABEL_PERSISTANT 26 10 (items/signpost.png) (_ "Information")} {ON_TILE 26 10 () ( {MENU_PERSISTANT () () (_ "Welcome to Creep Wars! If you are new to Creep War you should start with reading the introduction. For a deeper understanding, read the rules. There is also a changelog and a balances list. Have a nice game!") ( {MENU_OPTION (Introduction) ({CW_INTRODUCTION})} {MENU_OPTION (Game Rules) ({CW_GAME_RULES})} )} )} #enddef #define CW_SET_SHOPS {SET_IMAGE_AND_LABEL_PERSISTANT 8 9 (terrain/tent.png) (_ "Training Grounds")} {ON_TILE 8 9 (side=1,3,6) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {SHOP_HEALING} {SHOP_UPGRADES} )})} {SET_IMAGE_AND_LABEL_PERSISTANT 8 11 (terrain/tent.png) (_ "Training Grounds")} {ON_TILE 8 11 (side=1,3,6) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {SHOP_HEALING} {SHOP_UPGRADES} )})} {SET_IMAGE_AND_LABEL_PERSISTANT 28 9 (terrain/tent.png) (_ "Training Grounds")} {ON_TILE 28 9 (side=2,5,7) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {SHOP_HEALING} {SHOP_UPGRADES} )})} {SET_IMAGE_AND_LABEL_PERSISTANT 28 11 (terrain/tent.png) (_ "Training Grounds")} {ON_TILE 28 11 (side=2,5,7) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {SHOP_HEALING} {SHOP_UPGRADES} )})} {SET_IMAGE_AND_LABEL_PERSISTANT 14 8 (terrain/village-elven4.png) (_ "Mages' Guild")} {ON_TILE 14 8 (side=1,2,3,5,6,7) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {MENU_OPTION "Buy melee spells" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_MELEE_MAGICAL_ATTACKS})} )} {MENU_OPTION "Buy ranged spells" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_RANGED_MAGICAL_ATTACKS})} )} ## Removing the resistance options until wesnoth has a way to clearly show the modifications ## #{MENU_OPTION "Buy wards" ( # {SUBMENU () () "Your Gold: $gold" ({SHOP_MAGICAL_RESISTANCES})} #)} )})} {SET_IMAGE_AND_LABEL_PERSISTANT 22 12 (terrain/village-elven4.png) (_ "Mages' Guild")} {ON_TILE 22 12 (side=1,2,3,5,6,7) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {MENU_OPTION "Buy melee spells" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_MELEE_MAGICAL_ATTACKS})} )} {MENU_OPTION "Buy ranged spells" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_RANGED_MAGICAL_ATTACKS})} )} ## Removing the resistance options until wesnoth has a way to clearly show the modifications ## #{MENU_OPTION "Buy wards" ( # {SUBMENU () () "Your Gold: $gold" ({SHOP_MAGICAL_RESISTANCES})} #)} )})} {SET_IMAGE_AND_LABEL_PERSISTANT 14 12 (terrain/village-human4.png) (_ "Blacksmith")} {ON_TILE 14 12 (side=1,2,3,5,6,7) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {MENU_OPTION "Buy melee weapons" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_MELEE_ATTACKS})} )} {MENU_OPTION "Buy ranged weapons" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_RANGED_ATTACKS})} )} ## Removing the resistance options until wesnoth has a way to clearly show the modifications ## #{MENU_OPTION "Buy Armor" ( # {SUBMENU () () "Your Gold: $gold" ({SHOP_RESISTANCES})} #)} )})} {SET_IMAGE_AND_LABEL_PERSISTANT 22 8 (terrain/village-human4.png) (_ "Blacksmith")} {ON_TILE 22 8 (side=1,2,3,5,6,7) ({MENU_SHOP_PERSISTANT () () (_ "Your Gold: $gold") ( {MENU_OPTION "Buy melee weapons" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_MELEE_ATTACKS})} )} {MENU_OPTION "Buy ranged weapons" ( {SUBMENU () () "Your Gold: $gold" ({SHOP_RANGED_ATTACKS})} )} ## Removing the resistance options until wesnoth has a way to clearly show the modifications ## #{MENU_OPTION "Buy Armor" ( # {SUBMENU () () "Your Gold: $gold" ({SHOP_RESISTANCES})} #)} )})} #enddef #define CW_INTRODUCTION {MESSAGE narrator () () (In Creep War, you play a hero on one of the sides in a big battle. Every turn, the guards will recruit a unit and these units are named Creeps. The basic idea behind Creep War is for the heroes to help the Creeps win their everlasting battle by defeating the enemies Team Leader. If a hero dies he will be revived at home, and you can upgrade your hero by shopping in the training grounds, mages guild or blacksmith.)} #enddef #define CW_GAME_RULES {MESSAGE narrator () () (There are 4 main rules you will need to know about, in order to play Creep War. The first is that every turn there will spawn creeps from each guard, and that if a guard would die, it will no longer spawn creeps. The second rule is that when you die you get revived at home, with 50% health and you remain all upgrades you have bought. The third rule, is that you get gold from all kills. Everytime a creep, player or guard dies, the opposing teams players each get gold. For a creep, you get 5g, a player, 50g, and for a guard, 250g. The fourth, and final rule, is that when a Team Leader dies, the opposing team wins. So to win, kill the enemy Team Leader.)} #enddef ################################################ #define CW_SPAWN_CREEP SIDE TEAM X Y [event] name=side turn first_time_only=no [if] [variable] name=side_number equals={SIDE} [/variable] [have_unit] type=CW_Guard x={X} y={Y} [/have_unit] [then] {CW_SPAWN_ID {TEAM}} [/then] [/if] [/event] #enddef