// Méthode pour vérifier qu'un joueur soit bien citoyen d'une ville donnée public static bool IsPlayerCitizenOf(Mobile from, string town) { if (from == null) { return(false); } POMI thePomi = POMI.FindPomi(); if (thePomi == null) { return(false); } foreach (object v in thePomi.Villes) { if (v == null || !(v is TownStone)) { continue; } TownStone ville = (TownStone)v; if (ville.Nom.ToLower() == town.ToLower()) { return(ville.Citoyens.Contains(from)); } } return(false); }
// Scriptiz : méthode pour vérifier si un point se trouve à l'intérieur de la ville d'un PJ public static bool IsPointInPlayerTown(PlayerMobile from, Point2D location) { if (from == null) { return(false); } ArrayList villesPomi = POMI.FindPomi().Villes; TownStone ts = null; foreach (object o in villesPomi) { if (o is TownStone) { ts = (TownStone)o; } if (ts != null) { if (ts.Citoyens.Contains(from) && ts.Map == from.Map) { double distance = Math.Sqrt(Math.Pow(ts.Location.X - location.X, 2) + Math.Pow(ts.Location.Y - location.Y, 2)); if (distance > ts.MaxDistance) { from.SendMessage("Vous ne pouvez pas bâtir en dehors de votre ville."); return(false); } } } } return(true); }
public GuardSpawner(Point3D location, TownStone town) : base(0x1f13) { m_Running = false; Location = location; Map = town.Map; m_SpawnedGuard = null; m_Town = town; m_Delay = TimeSpan.FromSeconds(600.0); Visible = false; Movable = false; PomiGuard guard = new PomiGuard(m_Town, this); m_SpawnedGuard = guard; if (m_Town.GardesPNJ.Count > 0) { m_RangeHome = ((GuardSpawner)(m_Town.GardesPNJ[0])).RangeHome; } else { m_RangeHome = 5; } guard.Home = Location; guard.RangeHome = 5; Name = guard.Name; }
public DiplomatieGump( PlayerMobile from, TownStone town) : base( 20, 30 ) { m_Town = town; AddPage( 0 ); AddBackground( 0, 0, 420, 430, 5054 ); AddBackground( 10, 10, 400, 410, 3000 ); AddLabel( 160, 10, 0, "Diplomatie"); AddLabel( 130 + ((143 - (town.Nom.Length * 8)) / 2), 30, 0, town.Nom ); AddButton( 20, 70, 4005, 4007, 0, GumpButtonType.Page, 10 ); AddLabel( 55, 70, 0, "Alliés"); AddButton( 120, 70, 4005, 4007, 0, GumpButtonType.Page, 20 ); AddLabel( 155, 70, 0, "Paix"); AddButton( 220, 70, 4005, 4007, 0, GumpButtonType.Page, 30 ); AddLabel( 255, 70, 0, "Guerre"); AddButton( 320, 70, 4005, 4007, 0, GumpButtonType.Page, 40 ); AddLabel( 355, 70, 0, "Neutre"); AddLabel( 335, 390, 0,"Retour" ); // Quitter AddButton( 300, 390, 0xFAE, 0x0FB0, 1, GumpButtonType.Reply, 0 ); AjoutePage(1, m_Town.Allies); AjoutePage(2, m_Town.Paix); AjoutePage(3, m_Town.Guerre); AjoutePage(4, m_Town.Neutre); }
public DiplomatieGump(PlayerMobile from, TownStone town) : base(20, 30) { m_Town = town; AddPage(0); AddBackground(0, 0, 420, 430, 5054); AddBackground(10, 10, 400, 410, 3000); AddLabel(160, 10, 0, "Diplomatie"); AddLabel(130 + ((143 - (town.Nom.Length * 8)) / 2), 30, 0, town.Nom); AddButton(20, 70, 4005, 4007, 0, GumpButtonType.Page, 10); AddLabel(55, 70, 0, "Alliés"); AddButton(120, 70, 4005, 4007, 0, GumpButtonType.Page, 20); AddLabel(155, 70, 0, "Paix"); AddButton(220, 70, 4005, 4007, 0, GumpButtonType.Page, 30); AddLabel(255, 70, 0, "Guerre"); AddButton(320, 70, 4005, 4007, 0, GumpButtonType.Page, 40); AddLabel(355, 70, 0, "Neutre"); AddLabel(335, 390, 0, "Retour"); // Quitter AddButton(300, 390, 0xFAE, 0x0FB0, 1, GumpButtonType.Reply, 0); AjoutePage(1, m_Town.Allies); AjoutePage(2, m_Town.Paix); AjoutePage(3, m_Town.Guerre); AjoutePage(4, m_Town.Neutre); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_town = (TownStone)reader.ReadItem(); }
public CapitaineBook(TownStone town) : base(0xEFA) { m_town = town; LootType = LootType.Newbied; Weight = 0; Name = "Livre du Capitaine"; Hue = town.Hue; }
public PomiCloak(TownStone town, string titre) : base(0x1515) { m_town = town; m_titre = titre; LootType = LootType.Newbied; Weight = 0; Name = titre; Hue = town.Hue; }
private bool isEnnemi(PlayerMobile from, TownStone town) { PomiCloak pomicloak = from.FindItemOnLayer(Layer.Cloak) as PomiCloak; if(pomicloak != null && pomicloak.Name == "Ambassadeur") return false; foreach (TownStone ville in town.Guerre) if (ville.isCitoyen(from)) return true; return false; }
public bool TestRace(Mobile from, TownStone m_Town) { string raceville = m_Town.VilleRace.ToString(); string racejoueur = ((PlayerMobile)from).Race.Name; if (raceville == "Aucune") { return(true); } else if (from.AccessLevel >= AccessLevel.GameMaster) { return(true); } else if (raceville == "Humain" && ((racejoueur == "HumainHyel") || (racejoueur == "HumainOelm") || (racejoueur == "Voyageur"))) { return(true); } else if (raceville == "Drow" && racejoueur == "Drow") { return(true); } else if (raceville == "ElfeGlace" && racejoueur == "ElfeGlace") { return(true); } else if (raceville == "ElfeSylvain" && racejoueur == "ElfeSylvain") { return(true); } else if (raceville == "HautElfe" && racejoueur == "HautElfe") { return(true); } else if (raceville == "HautEtSylvain" && ((racejoueur == "HautElfe") || (racejoueur == "ElfeSylvain"))) { return(true); } else if (raceville == "Hobbit" && racejoueur == "Hobbit") { return(true); } else if (raceville == "Nain" && ((racejoueur == "NainMontagne") || (racejoueur == "NainColline"))) { return(true); } else { return(false); } }
public ChangeStatusGump(TownStone town, TownStone conflict) : base(50, 30) { m_Town = town; m_Conflict = conflict; AddPage(0); AddBackground(0, 0, 110, 120, 5054); AddBackground(10, 10, 90, 100, 3000); AddButton(20, 20, 2714, 2715, 1, GumpButtonType.Reply, 0); AddLabel(50, 21, 0, "Alliance"); AddButton(20, 40, 2714, 2715, 2, GumpButtonType.Reply, 0); AddLabel(50, 41, 0, "Paix"); AddButton(20, 60, 2714, 2715, 3, GumpButtonType.Reply, 0); AddLabel(50, 61, 0, "Guerre"); AddButton(20, 80, 2714, 2715, 4, GumpButtonType.Reply, 0); AddLabel(50, 81, 0, "Neutre"); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Delay = reader.ReadTimeSpan(); m_Town = (TownStone)reader.ReadItem(); m_SpawnedGuard = (PomiGuard)reader.ReadMobile(); m_RangeHome = reader.ReadInt(); m_Running = reader.ReadBool(); if (m_Running) { m_timer = new SpawnTimer(m_Town, this, m_Delay); m_timer.Start(); } }
public TownBox(TownStone Town) : base(0xE41) { m_Town = Town; Name = "Trésorerie"; Hue = Town.Hue; m_Town.Box = this; m_Payeurs = new ArrayList(); m_HistoPayeurs = new ArrayList(); m_Retard_1 = new ArrayList(); m_Retard_2 = new ArrayList(); m_Taxe = 500; m_CaisseVille = 0; m_CaisseGarde = 0; m_Delay = TimeSpan.FromDays(7.0); m_EndDate = DateTime.Now + m_Delay; m_TaxeTimer = new TaxeTimer(m_Town, m_Delay); m_TaxeTimer.Start(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Town = (TownStone)reader.ReadItem(); m_Payeurs = reader.ReadMobileList(); m_HistoPayeurs = reader.ReadMobileList(); m_Retard_1 = reader.ReadMobileList(); m_Retard_2 = reader.ReadMobileList(); m_Taxe = reader.ReadInt(); m_CaisseVille = reader.ReadInt(); m_CaisseGarde = reader.ReadInt(); m_EndDate = reader.ReadDateTime(); m_TaxeTimer = new TaxeTimer(m_Town, m_EndDate - DateTime.Now); m_TaxeTimer.Start(); m_Delay = reader.ReadTimeSpan(); }
public CapitaineBookGump(PlayerMobile from, TownStone town, CapitaineBook book) : base(20, 30) { m_Town = town; m_book = book; int i; AddPage(0); AddBackground(0, 0, 420, 430, 5054); AddBackground(10, 10, 400, 410, 3000); AddLabel(150, 10, 0, "Livre du Capitaine"); AddLabel(130 + ((143 - (town.Nom.Length * 8)) / 2), 30, 0, town.Nom); if (m_Town.Gardes.Count < 10) { AddLabel(40, 75, 0, "Nommer un Garde"); AddButton(20, 75, 2714, 2715, 1, GumpButtonType.Reply, 0); } if (m_Town.GardesPNJ.Count > 0) { AddLabel(250, 75, 0, "Rayon :"); AddTextEntry(300, 75, 100, 20, 0x384, 1, String.Format("{0}", ((GuardSpawner)(m_Town.GardesPNJ[0])).RangeHome)); AddButton(340, 75, 2714, 2715, 2, GumpButtonType.Reply, 0); } i = 0; foreach (PlayerMobile mobile in m_Town.Gardes) { AddLabel(40, 120 + i * 30, 0, mobile.Name); AddButton(15, 120 + i * 30, 0xA94, 0xA95, 100 + i, GumpButtonType.Reply, 0); try { AddLabel(220, 120 + i * 30, 0, String.Format("{0} {1}", ((GuardSpawner)(m_Town.GardesPNJ[i])).Name, ((GuardSpawner)(m_Town.GardesPNJ[i])).Location)); AddButton(200, 120 + i * 30, 0xA94, 0xA95, 250 + i, GumpButtonType.Reply, 0); } catch { AddLabel(220, 120 + i * 30, 0, "Ajouter Garde PNJ"); AddButton(200, 120 + i * 30, 2714, 2715, 200 + i, GumpButtonType.Reply, 0); } i++; } }
private void Neutre(TownStone Conflict) { if (m_Town.Allies.Contains(Conflict)) { m_Town.Allies.Remove(Conflict); } if (m_Town.Paix.Contains(Conflict)) { m_Town.Paix.Remove(Conflict); } if (m_Town.Guerre.Contains(Conflict)) { m_Town.Guerre.Remove(Conflict); } if (!m_Town.Neutre.Contains(Conflict)) { m_Town.Neutre.Add(Conflict); } }
public GuardSpawner(Point3D location, TownStone town) : base( 0x1f13 ) { m_Running = false; Location = location; Map = town.Map; m_SpawnedGuard = null; m_Town = town; m_Delay = TimeSpan.FromSeconds( 600.0 ); Visible = false; Movable = false; PomiGuard guard = new PomiGuard(m_Town, this); m_SpawnedGuard = guard; if(m_Town.GardesPNJ.Count > 0 ) m_RangeHome = ((GuardSpawner)(m_Town.GardesPNJ[0])).RangeHome; else m_RangeHome = 5; guard.Home = Location; guard.RangeHome = 5; Name = guard.Name; }
public override void OnDoubleClick( Mobile from ) { if ( from.AccessLevel >= AccessLevel.Administrator ) { TownStone town = new TownStone(this); from.Backpack.DropItem(town); m_Villes.Add(town); from.Backpack.DropItem(new TownBox(town)); foreach(TownStone othertown in m_Villes) { if(othertown != town ) othertown.Neutre.Add(town); town.Neutre.Add(othertown); } from.SendAsciiMessage( 0x482, "Nouvelle pierre de ville creee" ); } else { from.SendMessage( "Vous n'avez pas les acces pour administrer POMI" ); } }
public override void OnDoubleClick(Mobile from) { if (from.AccessLevel >= AccessLevel.Administrator) { TownStone town = new TownStone(this); from.Backpack.DropItem(town); m_Villes.Add(town); from.Backpack.DropItem(new TownBox(town)); foreach (TownStone othertown in m_Villes) { if (othertown != town) { othertown.Neutre.Add(town); } town.Neutre.Add(othertown); } from.SendAsciiMessage(0x482, "Nouvelle pierre de ville creee"); } else { from.SendMessage("Vous n'avez pas les acces pour administrer POMI"); } }
public bool TestRace(Mobile from, TownStone m_Town) { string raceville = m_Town.VilleRace.ToString(); string racejoueur = ((PlayerMobile)from).Race.Name; if (raceville == "Aucune") return true; else if (from.AccessLevel >= AccessLevel.GameMaster) return true; else if (raceville == "Humain" && ((racejoueur == "HumainHyel") || (racejoueur == "HumainOelm") || (racejoueur == "Voyageur"))) return true; else if (raceville == "Drow" && racejoueur == "Drow") return true; else if (raceville == "ElfeGlace" && racejoueur == "ElfeGlace") return true; else if (raceville == "ElfeSylvain" && racejoueur == "ElfeSylvain") return true; else if (raceville == "HautElfe" && racejoueur == "HautElfe") return true; else if (raceville == "HautEtSylvain" && ((racejoueur == "HautElfe") || (racejoueur == "ElfeSylvain"))) return true; else if (raceville == "Hobbit" && racejoueur == "Hobbit") return true; else if (raceville == "Nain" && ((racejoueur == "NainMontagne") || (racejoueur == "NainColline"))) return true; else return false; }
public PomiGuard(TownStone town, GuardSpawner spawn) : base(AIType.AI_Pomi, FightMode.Closest, 15, 1, 0.2, 1) { m_spawn = spawn; Location = m_spawn.Location; m_Town = town; Map = spawn.Map; InitStats(200, 200, 200); SpeechHue = Utility.RandomDyedHue(); Hue = Utility.RandomSkinHue(); Body = 0x190; Name = NameList.RandomName("male"); Title = "Garde de " + m_Town.Nom; PlateChest chest = new PlateChest(); chest.Hue = 0; chest.Movable = false; AddItem(chest); PlateArms arms = new PlateArms(); arms.Hue = 0; arms.Movable = false; AddItem(arms); PlateGloves gloves = new PlateGloves(); gloves.Hue = 0; gloves.Movable = false; AddItem(gloves); PlateGorget gorget = new PlateGorget(); gorget.Hue = 0; gorget.Movable = false; AddItem(gorget); PlateLegs legs = new PlateLegs(); legs.Hue = 0; legs.Movable = false; AddItem(legs); PlateHelm helm = new PlateHelm(); helm.Hue = 0; helm.Movable = false; AddItem(helm); Surcoat surcoat = new Surcoat(); surcoat.Hue = m_Town.Hue; surcoat.Movable = false; AddItem(surcoat); AddItem(new PomiCloak(m_Town, "Garde")); HairItemID = Utility.RandomList(0x203B, 0x203C, 0x203D, 0x2044, 0x2045, 0x2047, 0x2049, 0x204A); HairHue = Utility.RandomHairHue(); if (Utility.RandomBool()) { FacialHairItemID = Utility.RandomList(0x203E, 0x203F, 0x2040, 0x2041, 0x204B, 0x204C, 0x204D); FacialHairHue = HairHue; } Halberd weapon = new Halberd(); //weapon.Hue = m_Town.Hue; weapon.Movable = false; weapon.Crafter = this; weapon.Quality = WeaponQuality.Exceptional; VirtualArmor = 100; AddItem(weapon); Skills[SkillName.Anatomy].Base = 100.0; Skills[SkillName.Tactics].Base = 110.0; Skills[SkillName.Swords].Base = 160.0; Skills[SkillName.MagicResist].Base = 110.0; Skills[SkillName.DetectHidden].Base = 100.0; }
public TownHuePicker(int ItemID, TownStone town) : base(ItemID) { m_town = town; }
public TownGump(PlayerMobile from, TownStone town) : base(20, 30) { m_Town = town; bool isMaire = town.isMaire(from); bool isConseiller = town.isConseiller(from) || isMaire; bool isAmbassadeur = town.isAmbassadeur(from) || isConseiller; bool isCapitaine = town.isCapitaine(from) || isConseiller; bool isGarde = town.isGarde(from) || isCapitaine; bool isCitoyen = town.isCitoyen(from) || isAmbassadeur || isGarde; bool isHLL = town.isHLL(from); bool IsGM = isGM(from); int i; int x; int page; int nb_pages; AddPage(0); AddBackground(0, 0, 420, 430, 5054); AddBackground(10, 10, 400, 410, 3000); AddImage(130, 0, 100); AddLabel(130 + ((143 - (town.Nom.Length * 8)) / 2), 40, 0, town.Nom); AddLabel(55, 103, 0, "Infos"); // INFO AddButton(20, 103, 4005, 4007, 0, GumpButtonType.Page, 1); if (isCitoyen || IsGM) { AddLabel(170, 103, 0, "Citoyens"); // Citoyens AddButton(135, 103, 4005, 4007, 0, GumpButtonType.Page, 20); } if (isCapitaine || isAmbassadeur || IsGM) { AddLabel(295, 103, 0, "Gestion"); // Gestion AddButton(260, 103, 4005, 4007, 0, GumpButtonType.Page, 3); } AddLabel(335, 390, 0, "Quitter"); // Quitter AddButton(300, 390, 0xFB4, 0x0FB6, 0, GumpButtonType.Reply, 0); // Info page AddPage(1); // Scriptiz : on affiche les rawname au lieu de name pour éviter les modifs de la cagoule if (town.Maire != null) { AddLabel(20, 130, 0, "Bourgmestre de la ville : " + town.Maire.RawName); // Maire de la ville } else { AddLabel(20, 130, 0, "Bourgmestre de la ville : [ Poste vacant ]"); } if (town.Conseiller != null) { AddLabel(20, 150, 0, "Conseiller du Bourgmestre : " + town.Conseiller.RawName); // Conseiller } else { AddLabel(20, 150, 0, "Conseiller du Bourgmestre : [ Poste vacant ]"); } if (town.Ambassadeur != null) { AddLabel(20, 170, 0, "Ambassadeur : " + town.Ambassadeur.RawName); // Ambassadeur } else { AddLabel(20, 170, 0, "Ambassadeur : [ Poste vacant ]"); } if (town.Capitaine != null) { AddLabel(20, 190, 0, "Capitaine de la Garde : " + town.Capitaine.RawName); // Capitaine } else { AddLabel(20, 190, 0, "Capitaine de la Garde : [ Poste vacant ]"); } AddHtml(20, 220, 380, 140, town.Charte0 + "<br>" + town.Charte1 + "<br>" + town.Charte2 + "<br>" + town.Charte3 + "<br>" + town.Charte4 + "<br>" + town.Charte5 + "<br>" + town.Charte6 + "<br>" + town.Charte7, true, true); AddButton(90, 367, 2714, 2715, 0, GumpButtonType.Page, 50); AddLabel(115, 367, 0, "Hors la Loi"); AddButton(230, 367, 2714, 2715, 104, GumpButtonType.Reply, 0); AddLabel(255, 367, 0, "Diplomatie"); if (m_Town.Candidats.Contains(from)) { AddButton(30, 390, 0xFB1, 0xFB3, 102, GumpButtonType.Reply, 0); AddLabel(65, 390, 0, "Retirer sa candidature"); } else if (m_Town.Citoyens.Contains(from)) { AddButton(30, 390, 0xFA2, 0xFA4, 103, GumpButtonType.Reply, 0); AddLabel(65, 390, 0, "Demenager"); } else if (m_Town.Citoyens.Count < 499) { AddButton(30, 390, 0xFBD, 0xFBF, 101, GumpButtonType.Reply, 0); AddLabel(65, 390, 0, "Devenir Citoyen"); } // Citoyens AddPage(20); AddLabel(17, 125, 0x25, "Bourgmestre"); AddLabel(92, 125, 0x4D, "Conseiller"); AddLabel(149, 125, 0x7E, "Ambassadeur"); AddLabel(226, 125, 0x5A, "Capitaine"); AddLabel(284, 125, 0x5B, "Garde"); AddButton(319, 50, 0xFA8, 0xFAA, 0, GumpButtonType.Page, 8); AddLabel(350, 50, 0, "Elections"); i = 0; x = 0; page = 0; nb_pages = m_Town.Citoyens.Count / 33; foreach (PlayerMobile mobile in m_Town.Citoyens) { int couleur = 0; if (m_Town.isMaire(mobile)) { couleur = 0x25; } if (m_Town.isConseiller(mobile)) { couleur = 0x4D; } if (m_Town.isAmbassadeur(mobile)) { couleur = 0x7E; } if (m_Town.isCapitaine(mobile)) { couleur = 0x5A; } if (m_Town.isGarde(mobile)) { couleur = 0x5B; } if (x == 33) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 20 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 20 + page + 1); //next } if (page == 0 && nb_pages > 0) { AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 20 + page + 1); //next } x = 0; page++; AddPage(20 + page); if (page == nb_pages && nb_pages > 0) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 20 + page - 1); //previous } } AddLabel(20 + (((i / 11) % 3) * 125), 145 + ((i % 11) * 20), couleur, mobile.RawName); // Scriptiz : vrai nom i++; x++; } // Gestion de la ville AddPage(3); AddLabel(15, 130, 0, "Ville de"); if (IsGM) { AddTextEntry(70, 130, 100, 50, 0x384, 1, town.Nom); AddButton(170, 130, 2714, 2715, 301, GumpButtonType.Reply, 0); // Renomer la ville AddLabel(240, 130, 0, "Reinitialisation"); AddButton(380, 130, 2714, 2715, 311, GumpButtonType.Reply, 0); // Reinit de la ville AddLabel(240, 150, 0, "Nomer le Bourgmestre"); AddButton(380, 150, 2714, 2715, 302, GumpButtonType.Reply, 0); // Nomer le Maire AddLabel(240, 170, 0, "Forcer Elections"); AddButton(380, 170, 2714, 2715, 312, GumpButtonType.Reply, 0); // Forcer les Elections } else { AddLabel(70, 130, 0, town.Nom); } if (m_Town.Maire == from && !IsGM) { AddLabel(250, 130, 0, "Refaire une cape"); AddButton(350, 130, 2714, 2715, 310, GumpButtonType.Reply, 0); } if (isConseiller || IsGM) { AddLabel(45, 160, 0, "Liste des Citoyens"); //Liste des citoyens AddButton(20, 160, 2714, 2715, 0, GumpButtonType.Page, 60); AddLabel(45, 180, 0, "Liste des Candidats"); // Liste des Candidats AddButton(20, 180, 2714, 2715, 0, GumpButtonType.Page, 40); AddLabel(20, 240, 0, "Renvoyer"); AddLabel(125, 240, 0, "Nomer l'Ambassadeur"); // Nommer l'Ambassadeur AddButton(100, 240, 2714, 2715, 304, GumpButtonType.Reply, 0); AddButton(75, 240, 0xA94, 0xA95, 307, GumpButtonType.Reply, 0); AddLabel(20, 260, 0, "Renvoyer"); AddLabel(125, 260, 0, "Nomer le Capitaine de la Garde"); // Nommer le capitaine AddButton(100, 260, 2714, 2715, 305, GumpButtonType.Reply, 0); AddButton(75, 260, 0xA94, 0xA95, 308, GumpButtonType.Reply, 0); AddLabel(45, 280, 0, "Couleur de la Ville"); //Couleurs de la ville AddButton(20, 280, 2714, 2715, 309, GumpButtonType.Reply, 0); AddLabel(45, 300, 0, "Charte de la ville"); AddButton(20, 300, 2714, 2715, 312, GumpButtonType.Page, 7); AddLabel(45, 320, 0, "Diplomatie"); AddButton(20, 320, 2714, 2715, 312, GumpButtonType.Page, 90); } if (isMaire || IsGM) { AddLabel(20, 220, 0, "Renvoyer"); AddLabel(125, 220, 0, "Nomer le Conseiller"); // Nommer le conseiller AddButton(100, 220, 2714, 2715, 303, GumpButtonType.Reply, 0); AddButton(75, 220, 0xA94, 0xA95, 306, GumpButtonType.Reply, 0); } if (isCapitaine || IsGM) { AddLabel(45, 200, 0, "Gestion des Hors la Loi"); //Gestion des HLL AddButton(20, 200, 2714, 2715, 0, GumpButtonType.Page, 50); } // Affiche les candidatures i = 0; x = 0; page = 0; nb_pages = m_Town.Candidats.Count / 36; AddPage(40); foreach (PlayerMobile mobile in m_Town.Candidats) { if (x == 36) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 40 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 40 + page + 1); //next } if (page == 0 && nb_pages > 0) { AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 40 + page + 1); //next } x = 0; page++; AddPage(40 + page); if (page == nb_pages && nb_pages > 0) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 40 + page - 1); //previous } } AddLabel(60 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0, mobile.RawName); // Scriptiz : vrai nom AddButton(40 + ((x / 12) * 125), 137 + ((x % 12) * 20), 2714, 2715, 4000 + i, GumpButtonType.Reply, 0); AddButton(15 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0xA94, 0xA95, 4500 + i, GumpButtonType.Reply, 0); i++; x++; } //Gestion des HLL AddPage(50); if (isCapitaine || IsGM) { AddLabel(15, 125, 0, "Ajouter aux Hors la loi de la ville"); AddTextEntry(70, 125, 100, 50, 0x384, 2, "Entrer un nom"); AddButton(170, 126, 2714, 2715, 551, GumpButtonType.Reply, 0); } else { AddLabel(15, 125, 0, "Liste des Hors la loi de la ville"); } i = 0; x = 0; page = 0; nb_pages = m_Town.HLL.Count / 33; foreach (PlayerMobile mobile in m_Town.HLL) { if (x == 33) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 50 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 50 + page + 1); //next } if (page == 0 && nb_pages > 0) { AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 50 + page + 1); //next } x = 0; page++; AddPage(50 + page); if (page == nb_pages && nb_pages > 0) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 50 + page - 1); //previous } } AddLabel(40 + ((x / 11) * 125), 145 + ((x % 11) * 20), 0, mobile.RawName); // Scriptiz : on affiche le vrai nom ! if (isCapitaine || IsGM) { AddButton(15 + ((x / 11) * 125), 146 + ((x % 11) * 20), 0xA94, 0xA95, 5000 + i, GumpButtonType.Reply, 0); } i++; x++; } //Liste des citoyens AddPage(60); i = 0; x = 0; page = 0; nb_pages = m_Town.Citoyens.Count / 36; foreach (PlayerMobile mobile in m_Town.Citoyens) { if (x == 36) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 60 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 60 + page + 1); //next } if (page == 0 && nb_pages > 0) { AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 60 + page + 1); //next } x = 0; page++; AddPage(60 + page); if (page == nb_pages && nb_pages > 0) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 60 + page - 1); //previous } } AddLabel(40 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0, mobile.RawName); // Scriptiz : vrai nom AddButton(15 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0xA94, 0xA95, 6000 + i, GumpButtonType.Reply, 0); i++; x++; } //Charte de la ville AddPage(7); AddBackground(18, 138, 384, 24, 3000); AddTextEntry(20, 140, 380, 20, 0, 3, town.Charte0); AddBackground(18, 168, 384, 24, 3000); AddTextEntry(20, 170, 380, 20, 0, 4, town.Charte1); AddBackground(18, 198, 384, 24, 3000); AddTextEntry(20, 200, 380, 20, 0, 5, town.Charte2); AddBackground(18, 228, 384, 24, 3000); AddTextEntry(20, 230, 380, 20, 0, 6, town.Charte3); AddBackground(18, 258, 384, 24, 3000); AddTextEntry(20, 260, 380, 20, 0, 7, town.Charte4); AddBackground(18, 288, 384, 24, 3000); AddTextEntry(20, 290, 380, 20, 0, 8, town.Charte5); AddBackground(18, 318, 384, 24, 3000); AddTextEntry(20, 320, 380, 20, 0, 9, town.Charte6); AddBackground(18, 348, 384, 24, 3000); AddTextEntry(20, 350, 380, 20, 0, 10, town.Charte7); AddButton(50, 390, 4005, 4007, 701, GumpButtonType.Reply, 0); //Elections AddPage(8); AddLabel(15, 125, 0, String.Format("Fin des elections le {0} ", m_Town.EndDate)); i = 0; if (!m_Town.Votants.Contains(from)) { if (!m_Town.Elections.Contains(from) && m_Town.Elections.Count < 10) { AddLabel(75, 390, 0, "Candidature"); AddButton(40, 390, 0xFBD, 0xFBF, 81, GumpButtonType.Reply, 0); //Candidature Maire } } else { AddLabel(60, 390, 0, "Vous etes loyal a " + ((PlayerMobile)m_Town.Resultats[m_Town.Votants.IndexOf(from)]).RawName); // Scriptiz : vrai nom } foreach (PlayerMobile mobile in m_Town.Elections) { AddLabel(65, 150 + i * 20, 0, mobile.RawName); // Scriptiz : vrai nom if (!m_Town.Votants.Contains(from)) { AddButton(40, 150 + i * 20, 2714, 2715, 800 + i, GumpButtonType.Reply, 0); } if (IsGM) { AddButton(15, 150 + i * 20, 0xA94, 0xA95, 850 + i, GumpButtonType.Reply, 0); } i++; } //Diplomatie AddPage(90); AddLabel(20, 125, 0x25, "Guerre"); AddLabel(63, 125, 0x4D, "Neutre"); AddLabel(130, 125, 0x7E, "Alliance"); AddLabel(210, 125, 0x5A, "Paix"); i = 0; x = 0; page = 0; nb_pages = m_Town.Pomi.Villes.Count / 33; foreach (TownStone ville in m_Town.Pomi.Villes) { int couleur = 0; if (x == 33) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 90 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 90 + page + 1); //next } if (page == 0 && nb_pages > 0) { AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 90 + page + 1); //next } x = 0; page++; AddPage(90 + page); if (page == nb_pages && nb_pages > 0) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 90 + page - 1); //previous } } if (m_Town.Guerre.Contains(ville)) { couleur = 0x25; } if (m_Town.Neutre.Contains(ville)) { couleur = 0x4D; } if (m_Town.Allies.Contains(ville)) { couleur = 0x7E; } if (m_Town.Paix.Contains(ville)) { couleur = 0x5A; } if (ville != m_Town) { AddLabel(40 + ((x / 11) * 125), 145 + ((x % 11) * 20), couleur, ville.Nom); AddButton(15 + ((x / 11) * 125), 146 + ((x % 11) * 20), 0xA94, 0xA95, 9000 + i, GumpButtonType.Reply, 0); x++; } i++; } }
public PNJTarget(TownStone town) : base( -1, true, TargetFlags.None ) { m_Town = town; }
private void Neutre(TownStone Conflict) { if(m_Town.Allies.Contains(Conflict)) m_Town.Allies.Remove(Conflict); if(m_Town.Paix.Contains(Conflict)) m_Town.Paix.Remove(Conflict); if(m_Town.Guerre.Contains(Conflict)) m_Town.Guerre.Remove(Conflict); if(!m_Town.Neutre.Contains(Conflict)) m_Town.Neutre.Add(Conflict); }
public ChangeStatusGump( TownStone town, TownStone conflict) : base( 50, 30 ) { m_Town = town; m_Conflict = conflict; AddPage( 0 ); AddBackground( 0, 0, 110, 120, 5054 ); AddBackground( 10, 10, 90, 100, 3000 ); AddButton(20, 20, 2714, 2715 , 1, GumpButtonType.Reply, 0); AddLabel(50, 21, 0, "Alliance"); AddButton(20, 40, 2714, 2715, 2, GumpButtonType.Reply, 0); AddLabel(50, 41, 0, "Paix"); AddButton(20, 60, 2714, 2715, 3, GumpButtonType.Reply, 0); AddLabel(50, 61, 0, "Guerre"); AddButton(20, 80, 2714, 2715, 4, GumpButtonType.Reply, 0); AddLabel(50, 81, 0, "Neutre"); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_Town = (TownStone)reader.ReadItem(); m_Payeurs = reader.ReadMobileList(); m_HistoPayeurs = reader.ReadMobileList(); m_Retard_1 = reader.ReadMobileList(); m_Retard_2 = reader.ReadMobileList(); m_Taxe = reader.ReadInt(); m_CaisseVille = reader.ReadInt(); m_CaisseGarde = reader.ReadInt(); m_EndDate = reader.ReadDateTime(); m_TaxeTimer = new TaxeTimer(m_Town, m_EndDate - DateTime.Now); m_TaxeTimer.Start(); m_Delay = reader.ReadTimeSpan(); }
public TownBox(TownStone Town) : base( 0xE41 ) { m_Town = Town; Name = "Trésorerie"; Hue = Town.Hue; m_Town.Box = this; m_Payeurs = new ArrayList(); m_HistoPayeurs = new ArrayList(); m_Retard_1 = new ArrayList(); m_Retard_2 = new ArrayList(); m_Taxe = 500; m_CaisseVille = 0; m_CaisseGarde = 0; m_Delay = TimeSpan.FromDays( 7.0 ); m_EndDate = DateTime.Now + m_Delay; m_TaxeTimer = new TaxeTimer(m_Town, m_Delay); m_TaxeTimer.Start(); }
public SpawnTimer(TownStone town, GuardSpawner spawner, TimeSpan delay) : base(delay) { m_Town = town; m_spawner = spawner; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_Delay = reader.ReadTimeSpan(); m_Town = (TownStone)reader.ReadItem(); m_SpawnedGuard = (PomiGuard)reader.ReadMobile(); m_RangeHome = reader.ReadInt(); m_Running = reader.ReadBool(); if(m_Running) { m_timer = new SpawnTimer(m_Town, this, m_Delay); m_timer.Start(); } }
public TaxeTimer(TownStone town, TimeSpan delay) : base( delay ) { m_Town = town; }
public GestionTarget(TownStone town, int ButtonID) : base( -1, true, TargetFlags.None ) { m_Town = town; m_ButtonID = ButtonID; }
public TaxeTimer(TownStone town, TimeSpan delay) : base(delay) { m_Town = town; }
public ElectionTimer(TownStone town, TimeSpan delay) : base( delay ) { //Priority = TimerPriority.OneSecond; m_Town = town; }
public override void Deserialize(GenericReader reader) { base.Deserialize( reader ); int version = reader.ReadInt(); m_town = (TownStone)reader.ReadItem(); m_titre = reader.ReadString(); }
public BoxGump( PlayerMobile from,TownStone town, TownBox box ) : base( 20, 30 ) { m_Box = box; m_Town = town; bool isMaire = town.isMaire(from); bool isConseiller = town.isConseiller(from) || isMaire; bool isAmbassadeur = town.isAmbassadeur(from) || isConseiller; bool isCapitaine = town.isCapitaine(from); bool isGarde = town.isGarde(from) || isCapitaine; bool isCitoyen = town.isCitoyen(from) || isAmbassadeur || isGarde; bool isHLL = town.isHLL(from); bool IsGM = isGM(from); string payeurs = ""; //int don = 0; AddPage( 0 ); AddBackground( 0, 0, 420, 430, 5054 ); AddBackground( 10, 10, 400,410, 3000 ); AddLabel( 12, 12, 0,"Insp Gadget v1.0"); AddLabel( 32, 32, 0,"Freeze v1.1"); AddImage( 130, 0, 100 ); AddLabel( 130 + ((143 - (town.Nom.Length * 8)) / 2), 40, 0, m_Town.Nom ); AddLabel( 55, 103, 0, "Infos" ); // INFO AddButton( 20, 103, 4005, 4007, 0, GumpButtonType.Page, 1 ); if(isCitoyen || IsGM) { AddLabel( 170, 103, 0,"Taxes" ); // Feuille de paiement AddButton( 135, 103, 4005, 4007, 0, GumpButtonType.Page, 2 ); } if(isConseiller || isCapitaine || IsGM ) { AddLabel( 295, 103, 0,"Gestion" ); // Gestion AddButton( 260, 103, 4005, 4007, 0, GumpButtonType.Page, 3 ); } AddLabel( 345, 390, 0,"Quitter" ); // Quitter AddButton( 310, 390, 0xFB4, 0x0FB6, 0, GumpButtonType.Reply, 0 ); AddLabel( 20, 390, 0,"Faire un don de : Po à la ville!"); AddButton( 270, 390, 4005, 4007, 10, GumpButtonType.Reply, 0 ); AddTextEntry(130, 390, 50, 20, 0x384, 5, "0"); //INFOS AddPage( 1 ); AddLabel( 20, 130, 0, "Trésorie de la ville de " + m_Town.Nom); AddLabel(20, 200, 0, "Les taxes sont de " + m_Box.Taxe + " pieces d'or par semaine"); if(m_Box.Retard_1.Contains(from)) AddLabel(20, 250, 0x7E, "Vous avez du retard dans le paiement des taxes"); if(m_Box.Retard_2.Contains(from)) AddLabel(20, 270, 0x25, "Si vous ne payez pas vous serez expulsé"); AddLabel(20, 300, 0, String.Format("Prochain paiement le : {0}",m_Box.EndDate)); //TAXES AddPage( 2 ); if(m_Box.Payeurs.Contains(from)) AddLabel(20, 130, 0, "Vous avez payer vos taxes"); else { AddLabel(45, 130, 0, String.Format("Verser {0} pieces d'or", m_Box.Taxe)); AddButton( 20, 130, 2714, 2715, 20, GumpButtonType.Reply, 0); } AddLabel(20, 170, 0, "Budget de la ville :"); AddLabel(30, 190, 0, String.Format("Caisses de la ville {0}", m_Box.CaisseVille) ); AddLabel(30, 210, 0, String.Format("Caisses de la Garde {0}", m_Box.CaisseGarde) ); //GESTION AddPage( 3 ); if(isConseiller || IsGM) { AddLabel(20, 130, 0, "Montant de la Taxe : pieces"); AddTextEntry(160, 130, 50, 20, 0x384, 1, m_Box.Taxe.ToString()); AddButton(270, 130, 2714, 2715, 30, GumpButtonType.Reply, 0); } else AddLabel(20, 130, 0, String.Format("Montant de la Taxe : {0}",m_Box.Taxe)); if(isMaire || IsGM) { AddLabel(20, 150, 0, "Retirer Po de la Caisse Ville"); AddTextEntry(70, 150, 50, 20, 0x384, 2, m_Box.CaisseVille.ToString()); AddButton(270, 150, 2714, 2715, 31, GumpButtonType.Reply, 0); } if(isCapitaine || isMaire || IsGM) { AddLabel(20, 170, 0, "Retirer Po de la caisse Garde"); AddTextEntry(70, 170, 50, 20, 0x384, 3, m_Box.CaisseGarde.ToString()); AddButton(270, 170, 2714, 2715, 32, GumpButtonType.Reply, 0); } if( isMaire || IsGM) { AddLabel(20, 190, 0, "Basculer Po vers caisses : Ville Garde"); AddTextEntry(73, 190, 50, 20, 0x384, 4,"0" ); AddButton(270, 190, 2714, 2715, 34, GumpButtonType.Reply, 0); AddButton(350, 190, 2714, 2715, 35, GumpButtonType.Reply, 0); } if (isConseiller || IsGM) { AddLabel(20, 220, 0, "Creer un contrat Vendeur pour 2000 Po"); AddButton(270, 220, 2714, 2715, 33, GumpButtonType.Reply, 0); } AddLabel(20, 240, 0, "Liste des payeurs :"); foreach(PlayerMobile mobile in m_Box.Payeurs) payeurs = payeurs + mobile.Name + ", "; AddHtml(20, 260, 380, 120, payeurs, true, true); }
public GestionTarget(TownStone town, int ButtonID) : base(-1, true, TargetFlags.None) { m_Town = town; m_ButtonID = ButtonID; }
public BoxGump(PlayerMobile from, TownStone town, TownBox box) : base(20, 30) { m_Box = box; m_Town = town; bool isMaire = town.isMaire(from); bool isConseiller = town.isConseiller(from) || isMaire; bool isAmbassadeur = town.isAmbassadeur(from) || isConseiller; bool isCapitaine = town.isCapitaine(from); bool isGarde = town.isGarde(from) || isCapitaine; bool isCitoyen = town.isCitoyen(from) || isAmbassadeur || isGarde; bool isHLL = town.isHLL(from); bool IsGM = isGM(from); string payeurs = ""; //int don = 0; AddPage(0); AddBackground(0, 0, 420, 430, 5054); AddBackground(10, 10, 400, 410, 3000); AddLabel(12, 12, 0, "Insp Gadget v1.0"); AddLabel(32, 32, 0, "Freeze v1.1"); AddImage(130, 0, 100); AddLabel(130 + ((143 - (town.Nom.Length * 8)) / 2), 40, 0, m_Town.Nom); AddLabel(55, 103, 0, "Infos"); // INFO AddButton(20, 103, 4005, 4007, 0, GumpButtonType.Page, 1); if (isCitoyen || IsGM) { AddLabel(170, 103, 0, "Taxes"); // Feuille de paiement AddButton(135, 103, 4005, 4007, 0, GumpButtonType.Page, 2); } if (isConseiller || isCapitaine || IsGM) { AddLabel(295, 103, 0, "Gestion"); // Gestion AddButton(260, 103, 4005, 4007, 0, GumpButtonType.Page, 3); } AddLabel(345, 390, 0, "Quitter"); // Quitter AddButton(310, 390, 0xFB4, 0x0FB6, 0, GumpButtonType.Reply, 0); AddLabel(20, 390, 0, "Faire un don de : Po à la ville!"); AddButton(270, 390, 4005, 4007, 10, GumpButtonType.Reply, 0); AddTextEntry(130, 390, 50, 20, 0x384, 5, "0"); //INFOS AddPage(1); AddLabel(20, 130, 0, "Trésorie de la ville de " + m_Town.Nom); AddLabel(20, 200, 0, "Les taxes sont de " + m_Box.Taxe + " pieces d'or par semaine"); if (m_Box.Retard_1.Contains(from)) { AddLabel(20, 250, 0x7E, "Vous avez du retard dans le paiement des taxes"); } if (m_Box.Retard_2.Contains(from)) { AddLabel(20, 270, 0x25, "Si vous ne payez pas vous serez expulsé"); } AddLabel(20, 300, 0, String.Format("Prochain paiement le : {0}", m_Box.EndDate)); //TAXES AddPage(2); if (m_Box.Payeurs.Contains(from)) { AddLabel(20, 130, 0, "Vous avez payer vos taxes"); } else { AddLabel(45, 130, 0, String.Format("Verser {0} pieces d'or", m_Box.Taxe)); AddButton(20, 130, 2714, 2715, 20, GumpButtonType.Reply, 0); } AddLabel(20, 170, 0, "Budget de la ville :"); AddLabel(30, 190, 0, String.Format("Caisses de la ville {0}", m_Box.CaisseVille)); AddLabel(30, 210, 0, String.Format("Caisses de la Garde {0}", m_Box.CaisseGarde)); //GESTION AddPage(3); if (isConseiller || IsGM) { AddLabel(20, 130, 0, "Montant de la Taxe : pieces"); AddTextEntry(160, 130, 50, 20, 0x384, 1, m_Box.Taxe.ToString()); AddButton(270, 130, 2714, 2715, 30, GumpButtonType.Reply, 0); } else { AddLabel(20, 130, 0, String.Format("Montant de la Taxe : {0}", m_Box.Taxe)); } if (isMaire || IsGM) { AddLabel(20, 150, 0, "Retirer Po de la Caisse Ville"); AddTextEntry(70, 150, 50, 20, 0x384, 2, m_Box.CaisseVille.ToString()); AddButton(270, 150, 2714, 2715, 31, GumpButtonType.Reply, 0); } if (isCapitaine || isMaire || IsGM) { AddLabel(20, 170, 0, "Retirer Po de la caisse Garde"); AddTextEntry(70, 170, 50, 20, 0x384, 3, m_Box.CaisseGarde.ToString()); AddButton(270, 170, 2714, 2715, 32, GumpButtonType.Reply, 0); } if (isMaire || IsGM) { AddLabel(20, 190, 0, "Basculer Po vers caisses : Ville Garde"); AddTextEntry(73, 190, 50, 20, 0x384, 4, "0"); AddButton(270, 190, 2714, 2715, 34, GumpButtonType.Reply, 0); AddButton(350, 190, 2714, 2715, 35, GumpButtonType.Reply, 0); } if (isConseiller || IsGM) { AddLabel(20, 220, 0, "Creer un contrat Vendeur pour 2000 Po"); AddButton(270, 220, 2714, 2715, 33, GumpButtonType.Reply, 0); } AddLabel(20, 240, 0, "Liste des payeurs :"); foreach (PlayerMobile mobile in m_Box.Payeurs) { payeurs = payeurs + mobile.Name + ", "; } AddHtml(20, 260, 380, 120, payeurs, true, true); }
public PNJTarget(TownStone town) : base(-1, true, TargetFlags.None) { m_Town = town; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_spawn = (GuardSpawner)reader.ReadItem(); m_Town = (TownStone)reader.ReadItem(); }
public ElectionTimer(TownStone town, TimeSpan delay) : base(delay) { //Priority = TimerPriority.OneSecond; m_Town = town; }
public TownGump(PlayerMobile from, TownStone town) : base(20, 30) { m_Town = town; bool isMaire = town.isMaire(from); bool isConseiller = town.isConseiller(from) || isMaire; bool isAmbassadeur = town.isAmbassadeur(from) || isConseiller; bool isCapitaine = town.isCapitaine(from) || isConseiller; bool isGarde = town.isGarde(from) || isCapitaine; bool isCitoyen = town.isCitoyen(from) || isAmbassadeur || isGarde; bool isHLL = town.isHLL(from); bool IsGM = isGM(from); int i; int x; int page; int nb_pages; AddPage(0); AddBackground(0, 0, 420, 430, 5054); AddBackground(10, 10, 400, 410, 3000); AddImage(130, 0, 100); AddLabel(130 + ((143 - (town.Nom.Length * 8)) / 2), 40, 0, town.Nom); AddLabel(55, 103, 0, "Infos"); // INFO AddButton(20, 103, 4005, 4007, 0, GumpButtonType.Page, 1); if (isCitoyen || IsGM) { AddLabel(170, 103, 0, "Citoyens"); // Citoyens AddButton(135, 103, 4005, 4007, 0, GumpButtonType.Page, 20); } if (isCapitaine || isAmbassadeur || IsGM) { AddLabel(295, 103, 0, "Gestion"); // Gestion AddButton(260, 103, 4005, 4007, 0, GumpButtonType.Page, 3); } AddLabel(335, 390, 0, "Quitter"); // Quitter AddButton(300, 390, 0xFB4, 0x0FB6, 0, GumpButtonType.Reply, 0); // Info page AddPage(1); // Scriptiz : on affiche les rawname au lieu de name pour éviter les modifs de la cagoule if (town.Maire != null) AddLabel(20, 130, 0, "Bourgmestre de la ville : " + town.Maire.RawName); // Maire de la ville else AddLabel(20, 130, 0, "Bourgmestre de la ville : [ Poste vacant ]"); if (town.Conseiller != null) AddLabel(20, 150, 0, "Conseiller du Bourgmestre : " + town.Conseiller.RawName); // Conseiller else AddLabel(20, 150, 0, "Conseiller du Bourgmestre : [ Poste vacant ]"); if (town.Ambassadeur != null) AddLabel(20, 170, 0, "Ambassadeur : " + town.Ambassadeur.RawName); // Ambassadeur else AddLabel(20, 170, 0, "Ambassadeur : [ Poste vacant ]"); if (town.Capitaine != null) AddLabel(20, 190, 0, "Capitaine de la Garde : " + town.Capitaine.RawName); // Capitaine else AddLabel(20, 190, 0, "Capitaine de la Garde : [ Poste vacant ]"); AddHtml(20, 220, 380, 140, town.Charte0 + "<br>" + town.Charte1 + "<br>" + town.Charte2 + "<br>" + town.Charte3 + "<br>" + town.Charte4 + "<br>" + town.Charte5 + "<br>" + town.Charte6 + "<br>" + town.Charte7, true, true); AddButton(90, 367, 2714, 2715, 0, GumpButtonType.Page, 50); AddLabel(115, 367, 0, "Hors la Loi"); AddButton(230, 367, 2714, 2715, 104, GumpButtonType.Reply, 0); AddLabel(255, 367, 0, "Diplomatie"); if (m_Town.Candidats.Contains(from)) { AddButton(30, 390, 0xFB1, 0xFB3, 102, GumpButtonType.Reply, 0); AddLabel(65, 390, 0, "Retirer sa candidature"); } else if (m_Town.Citoyens.Contains(from)) { AddButton(30, 390, 0xFA2, 0xFA4, 103, GumpButtonType.Reply, 0); AddLabel(65, 390, 0, "Demenager"); } else if (m_Town.Citoyens.Count < 499) { AddButton(30, 390, 0xFBD, 0xFBF, 101, GumpButtonType.Reply, 0); AddLabel(65, 390, 0, "Devenir Citoyen"); } // Citoyens AddPage(20); AddLabel(17, 125, 0x25, "Bourgmestre"); AddLabel(92, 125, 0x4D, "Conseiller"); AddLabel(149, 125, 0x7E, "Ambassadeur"); AddLabel(226, 125, 0x5A, "Capitaine"); AddLabel(284, 125, 0x5B, "Garde"); AddButton(319, 50, 0xFA8, 0xFAA, 0, GumpButtonType.Page, 8); AddLabel(350, 50, 0, "Elections"); i = 0; x = 0; page = 0; nb_pages = m_Town.Citoyens.Count / 33; foreach (PlayerMobile mobile in m_Town.Citoyens) { int couleur = 0; if (m_Town.isMaire(mobile)) couleur = 0x25; if (m_Town.isConseiller(mobile)) couleur = 0x4D; if (m_Town.isAmbassadeur(mobile)) couleur = 0x7E; if (m_Town.isCapitaine(mobile)) couleur = 0x5A; if (m_Town.isGarde(mobile)) couleur = 0x5B; if (x == 33) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 20 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 20 + page + 1); //next } if (page == 0 && nb_pages > 0) AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 20 + page + 1); //next x = 0; page++; AddPage(20 + page); if (page == nb_pages && nb_pages > 0) AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 20 + page - 1); //previous } AddLabel(20 + (((i / 11) % 3) * 125), 145 + ((i % 11) * 20), couleur, mobile.RawName); // Scriptiz : vrai nom i++; x++; } // Gestion de la ville AddPage(3); AddLabel(15, 130, 0, "Ville de"); if (IsGM) { AddTextEntry(70, 130, 100, 50, 0x384, 1, town.Nom); AddButton(170, 130, 2714, 2715, 301, GumpButtonType.Reply, 0); // Renomer la ville AddLabel(240, 130, 0, "Reinitialisation"); AddButton(380, 130, 2714, 2715, 311, GumpButtonType.Reply, 0); // Reinit de la ville AddLabel(240, 150, 0, "Nomer le Bourgmestre"); AddButton(380, 150, 2714, 2715, 302, GumpButtonType.Reply, 0); // Nomer le Maire AddLabel(240, 170, 0, "Forcer Elections"); AddButton(380, 170, 2714, 2715, 312, GumpButtonType.Reply, 0); // Forcer les Elections } else AddLabel(70, 130, 0, town.Nom); if (m_Town.Maire == from && !IsGM) { AddLabel(250, 130, 0, "Refaire une cape"); AddButton(350, 130, 2714, 2715, 310, GumpButtonType.Reply, 0); } if (isConseiller || IsGM) { AddLabel(45, 160, 0, "Liste des Citoyens"); //Liste des citoyens AddButton(20, 160, 2714, 2715, 0, GumpButtonType.Page, 60); AddLabel(45, 180, 0, "Liste des Candidats"); // Liste des Candidats AddButton(20, 180, 2714, 2715, 0, GumpButtonType.Page, 40); AddLabel(20, 240, 0, "Renvoyer"); AddLabel(125, 240, 0, "Nomer l'Ambassadeur"); // Nommer l'Ambassadeur AddButton(100, 240, 2714, 2715, 304, GumpButtonType.Reply, 0); AddButton(75, 240, 0xA94, 0xA95, 307, GumpButtonType.Reply, 0); AddLabel(20, 260, 0, "Renvoyer"); AddLabel(125, 260, 0, "Nomer le Capitaine de la Garde"); // Nommer le capitaine AddButton(100, 260, 2714, 2715, 305, GumpButtonType.Reply, 0); AddButton(75, 260, 0xA94, 0xA95, 308, GumpButtonType.Reply, 0); AddLabel(45, 280, 0, "Couleur de la Ville"); //Couleurs de la ville AddButton(20, 280, 2714, 2715, 309, GumpButtonType.Reply, 0); AddLabel(45, 300, 0, "Charte de la ville"); AddButton(20, 300, 2714, 2715, 312, GumpButtonType.Page, 7); AddLabel(45, 320, 0, "Diplomatie"); AddButton(20, 320, 2714, 2715, 312, GumpButtonType.Page, 90); } if (isMaire || IsGM) { AddLabel(20, 220, 0, "Renvoyer"); AddLabel(125, 220, 0, "Nomer le Conseiller"); // Nommer le conseiller AddButton(100, 220, 2714, 2715, 303, GumpButtonType.Reply, 0); AddButton(75, 220, 0xA94, 0xA95, 306, GumpButtonType.Reply, 0); } if (isCapitaine || IsGM) { AddLabel(45, 200, 0, "Gestion des Hors la Loi"); //Gestion des HLL AddButton(20, 200, 2714, 2715, 0, GumpButtonType.Page, 50); } // Affiche les candidatures i = 0; x = 0; page = 0; nb_pages = m_Town.Candidats.Count / 36; AddPage(40); foreach (PlayerMobile mobile in m_Town.Candidats) { if (x == 36) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 40 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 40 + page + 1); //next } if (page == 0 && nb_pages > 0) AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 40 + page + 1); //next x = 0; page++; AddPage(40 + page); if (page == nb_pages && nb_pages > 0) AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 40 + page - 1); //previous } AddLabel(60 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0, mobile.RawName); // Scriptiz : vrai nom AddButton(40 + ((x / 12) * 125), 137 + ((x % 12) * 20), 2714, 2715, 4000 + i, GumpButtonType.Reply, 0); AddButton(15 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0xA94, 0xA95, 4500 + i, GumpButtonType.Reply, 0); i++; x++; } //Gestion des HLL AddPage(50); if (isCapitaine || IsGM) { AddLabel(15, 125, 0, "Ajouter aux Hors la loi de la ville"); AddTextEntry(70, 125, 100, 50, 0x384, 2, "Entrer un nom"); AddButton(170, 126, 2714, 2715, 551, GumpButtonType.Reply, 0); } else AddLabel(15, 125, 0, "Liste des Hors la loi de la ville"); i = 0; x = 0; page = 0; nb_pages = m_Town.HLL.Count / 33; foreach (PlayerMobile mobile in m_Town.HLL) { if (x == 33) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 50 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 50 + page + 1); //next } if (page == 0 && nb_pages > 0) AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 50 + page + 1); //next x = 0; page++; AddPage(50 + page); if (page == nb_pages && nb_pages > 0) AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 50 + page - 1); //previous } AddLabel(40 + ((x / 11) * 125), 145 + ((x % 11) * 20), 0, mobile.RawName); // Scriptiz : on affiche le vrai nom ! if (isCapitaine || IsGM) AddButton(15 + ((x / 11) * 125), 146 + ((x % 11) * 20), 0xA94, 0xA95, 5000 + i, GumpButtonType.Reply, 0); i++; x++; } //Liste des citoyens AddPage(60); i = 0; x = 0; page = 0; nb_pages = m_Town.Citoyens.Count / 36; foreach (PlayerMobile mobile in m_Town.Citoyens) { if (x == 36) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 60 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 60 + page + 1); //next } if (page == 0 && nb_pages > 0) AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 60 + page + 1); //next x = 0; page++; AddPage(60 + page); if (page == nb_pages && nb_pages > 0) AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 60 + page - 1); //previous } AddLabel(40 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0, mobile.RawName); // Scriptiz : vrai nom AddButton(15 + ((x / 12) * 125), 137 + ((x % 12) * 20), 0xA94, 0xA95, 6000 + i, GumpButtonType.Reply, 0); i++; x++; } //Charte de la ville AddPage(7); AddBackground(18, 138, 384, 24, 3000); AddTextEntry(20, 140, 380, 20, 0, 3, town.Charte0); AddBackground(18, 168, 384, 24, 3000); AddTextEntry(20, 170, 380, 20, 0, 4, town.Charte1); AddBackground(18, 198, 384, 24, 3000); AddTextEntry(20, 200, 380, 20, 0, 5, town.Charte2); AddBackground(18, 228, 384, 24, 3000); AddTextEntry(20, 230, 380, 20, 0, 6, town.Charte3); AddBackground(18, 258, 384, 24, 3000); AddTextEntry(20, 260, 380, 20, 0, 7, town.Charte4); AddBackground(18, 288, 384, 24, 3000); AddTextEntry(20, 290, 380, 20, 0, 8, town.Charte5); AddBackground(18, 318, 384, 24, 3000); AddTextEntry(20, 320, 380, 20, 0, 9, town.Charte6); AddBackground(18, 348, 384, 24, 3000); AddTextEntry(20, 350, 380, 20, 0, 10, town.Charte7); AddButton(50, 390, 4005, 4007, 701, GumpButtonType.Reply, 0); //Elections AddPage(8); AddLabel(15, 125, 0, String.Format("Fin des elections le {0} ", m_Town.EndDate)); i = 0; if (!m_Town.Votants.Contains(from)) { if (!m_Town.Elections.Contains(from) && m_Town.Elections.Count < 10) { AddLabel(75, 390, 0, "Candidature"); AddButton(40, 390, 0xFBD, 0xFBF, 81, GumpButtonType.Reply, 0); //Candidature Maire } } else { AddLabel(60, 390, 0, "Vous etes loyal a " + ((PlayerMobile)m_Town.Resultats[m_Town.Votants.IndexOf(from)]).RawName); // Scriptiz : vrai nom } foreach (PlayerMobile mobile in m_Town.Elections) { AddLabel(65, 150 + i * 20, 0, mobile.RawName); // Scriptiz : vrai nom if (!m_Town.Votants.Contains(from)) AddButton(40, 150 + i * 20, 2714, 2715, 800 + i, GumpButtonType.Reply, 0); if (IsGM) AddButton(15, 150 + i * 20, 0xA94, 0xA95, 850 + i, GumpButtonType.Reply, 0); i++; } //Diplomatie AddPage(90); AddLabel(20, 125, 0x25, "Guerre"); AddLabel(63, 125, 0x4D, "Neutre"); AddLabel(130, 125, 0x7E, "Alliance"); AddLabel(210, 125, 0x5A, "Paix"); i = 0; x = 0; page = 0; nb_pages = m_Town.Pomi.Villes.Count / 33; foreach (TownStone ville in m_Town.Pomi.Villes) { int couleur = 0; if (x == 33) { if (page > 0 && page < nb_pages) { AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 90 + page - 1); //previous AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 90 + page + 1); //next } if (page == 0 && nb_pages > 0) AddButton(160, 390, 0xFA5, 0x0FA7, 0, GumpButtonType.Page, 90 + page + 1); //next x = 0; page++; AddPage(90 + page); if (page == nb_pages && nb_pages > 0) AddButton(60, 390, 0xFAE, 0x0FB0, 0, GumpButtonType.Page, 90 + page - 1); //previous } if (m_Town.Guerre.Contains(ville)) couleur = 0x25; if (m_Town.Neutre.Contains(ville)) couleur = 0x4D; if (m_Town.Allies.Contains(ville)) couleur = 0x7E; if (m_Town.Paix.Contains(ville)) couleur = 0x5A; if (ville != m_Town) { AddLabel(40 + ((x / 11) * 125), 145 + ((x % 11) * 20), couleur, ville.Nom); AddButton(15 + ((x / 11) * 125), 146 + ((x % 11) * 20), 0xA94, 0xA95, 9000 + i, GumpButtonType.Reply, 0); x++; } i++; } }
public SpawnTimer(TownStone town, GuardSpawner spawner, TimeSpan delay) : base( delay ) { m_Town = town; m_spawner = spawner; }