HEKPOMAHT
Участник
>>>=) вам сюда =)и вам отсюда !!!!
licq:2723
|
|
DimonD
Участник
Don`t FeaR The ReaPer (c) Him
|
|
-kr1k-
Участник
Peace doo ball
licq:1294
|
|
Prof
Участник
•resurreXi¤n•
licq:1840
|
|
rope
Участник
psychosomatic addict insane
licq:1607
|
|
Muzz1e
Участник
pro100 мазл...
licq:2655
|
|
Кор
Участник
IceICQ:12826
licq:2826
|
|
redline
Участник
w.d. lab™
licq:1122
|
отправлено: 06-09-2005 12:01:52 | |
инфо • правка • ссылка • сообщить модератору |
2 Кор цитата: using System; using Server; using Server.Items; using Server.Network; using Server.Mobiles; using Server.Misc; using Server.Gumps; using Server.Prompts; using System.Collections; using Server.Targeting; using Server.Regions; using Server.Spells; using Server.Spells.Third; using Server.Spells.Seventh; using Server.Spells.Fourth; using Server.Spells.Sixth; using Server.Spells.Chivalry; namespace Server.Regions { public class new_Arena : Region { Item m_Controller; ArrayList Mobs; int max_players; Point3D oloc; public new_Arena( Item controler, Map map ) : base( "", "", map) //, typeof( WarriorGuard ) ) { LoadFromXml = false; Priority = Region.HousePriority; m_Controller = controler; tabl_Arena1 tj =m_Controller as tabl_Arena1; Point3D sloc= tj.Start_coordinat; Point3D eloc= tj.End_coordinat; oloc= tj.Out_coordinat; max_players = tj.max_players; Coords = new ArrayList(); Coords.Add( new Rectangle2D(sloc.X , sloc.Y, eloc.X - sloc.X , eloc.Y - sloc.Y) ); GoLocation = m_Controller.Location; Region.AddRegion( this ); World.Broadcast( 0x54, false, " region Arena удачно стартовал"); } public override void AlterLightLevel( Mobile m, ref int global, ref int personal ) { tabl_Arena1 tj =m_Controller as tabl_Arena1; global =tj.LightLevel; } public override bool AllowHousing( Mobile from, Point3D p ) { return false; } public override void OnPlayerAdd( Mobile m ) { if (m.Player && m.Alive ) { m.SendMessage(33, "Ты вошёл на Арену "); m.Warmode = true; } else { m.SendMessage(33, "Арена занята"); } } public override bool OnMoveInto( Mobile m, Direction d, Point3D newLocation, Point3D oldLocation ) { if (m.Player && m.Alive) { Mobs = this.Players; if ( Mobs.Count <= max_players ) { return true; } else { m.X = oloc.X; m.Y = oloc.Y; m.Z = oloc.Z; return false; } } else { return false; } } public override void OnPlayerRemove( Mobile m ) { if (m.Player) { m.SendMessage(33, "Ты вышел с Арены"); m.Blessed = false; m.Warmode = false; } } public override void OnAggressed( Mobile aggressor, Mobile aggressed, bool criminal ) { criminal = false; } public override void OnSpeech( SpeechEventArgs e ) { Mobile from = e.Mobile; if ( e.Speech == "out" && ( Mobs.Count == 1 ) && ( from.Hits == from.HitsMax )) { from.X = oloc.X; from.Y = oloc.Y; from.Z = oloc.Z; } } public override bool OnDeath(Mobile m) { m.X = oloc.X; m.Y = oloc.Y; m.Z = oloc.Z; //m.Hits = 10; return false; } public override bool OnBeginSpellCast( Mobile m, ISpell s ) { if ( s is GateTravelSpell || s is RecallSpell || s is MarkSpell || s is TeleportSpell || s is SacredJourneySpell ) { m.SendMessage(33, "Ты не можешь использовать это заклинание на Арене"); return false; } else { return base.OnBeginSpellCast( m, s ); } } public override bool OnDoubleClick( Mobile m, object o ) { if( o is Corpse ) { Corpse c = (Corpse)o; bool canLoot; if( c.Owner == m ) canLoot = true; else if ( c.Owner is PlayerMobile ) canLoot = false; else canLoot = false; if( !canLoot ) m.SendMessage( "На арене нельзя лутать чужие трупы." ); if ( m.AccessLevel >= AccessLevel.GameMaster && !canLoot ) { m.SendMessage( "This is unlootable but you are able to open that with your Godly powers." ); return true; } return canLoot; } return base.OnDoubleClick( m, o ); } } } namespace Server.Items { public class tabl_Arena1 : Item { public Region m_Region; public Region Region { get{ return m_Region; } set{ m_Region = value; } } public void Start() { if ( m_Active || Deleted ) return; m_Active = true; if ( m_Region != null ) Region.RemoveRegion( m_Region ); m_Region = new new_Arena( this, this.Map ); //World.Broadcast( 0x35, false, "start region"); } public void Stop() { if ( !m_Active || Deleted ) return; m_Active = false; if ( m_Region != null ) Region.RemoveRegion( m_Region ); m_Region = null; } public int m_LightLevel; [CommandProperty( AccessLevel.GameMaster )] public int LightLevel { get { return m_LightLevel; } set { m_LightLevel = value; InvalidateProperties(); } } private bool m_Active; [CommandProperty( AccessLevel.GameMaster )] public bool Active { get { return m_Active; } set { if ( value ) Start(); else Stop(); InvalidateProperties(); } } public Point3D coordinate_start; [CommandProperty( AccessLevel.GameMaster )] public Point3D Start_coordinat { get { return coordinate_start; } set { coordinate_start = value; InvalidateProperties(); } } public Point3D coordinate_end; [CommandProperty( AccessLevel.GameMaster )] public Point3D End_coordinat { get { return coordinate_end; } set { coordinate_end= value; InvalidateProperties(); } } public Point3D coordinate_out; [CommandProperty( AccessLevel.GameMaster )] public Point3D Out_coordinat { get { return coordinate_out; } set { coordinate_out = value; InvalidateProperties(); } } public int players_max; [CommandProperty( AccessLevel.GameMaster )] public int max_players { get { return players_max; } set { players_max = value; InvalidateProperties(); } } [Constructable] public tabl_Arena1() : base( 3026 ) { Movable=false; m_Active=false; m_LightLevel=0; } public override void AddNameProperty( ObjectPropertyList list ) { list.Add( "Арена" ); } public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); if ( m_Active ) { list.Add( 1060742 ); // active list.Add( 1060658, "координаты региона\t{0}", coordinate_start.ToString()+" - " + coordinate_end.ToString()); list.Add( 1060659, "уровень освещения\t{0}", m_LightLevel.ToString()); list.Add( 1060660, "WARNING : \t{0}", "НЕ удалять, это контролер региона!"); } else { list.Add( 1060743 ); // inactive list.Add( 1060658, "координаты региона\t{0}", coordinate_start.ToString()+" - " + coordinate_end.ToString()); list.Add( 1060659, "WARNING \t{0}", "НЕ удалять, это контролер региона!"); } } public tabl_Arena1( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version writer.Write( (bool) m_Active ); writer.Write( coordinate_start); writer.Write( coordinate_end); writer.Write( m_LightLevel); writer.Write( coordinate_out); writer.Write( players_max); } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_Active = reader.ReadBool(); coordinate_start= reader.ReadPoint3D(); coordinate_end= reader.ReadPoint3D(); m_LightLevel=reader.ReadInt(); coordinate_out= reader.ReadPoint3D(); players_max=reader.ReadInt(); if(m_Active) m_Region = new new_Arena( this, this.Map ); } } } |
|
IP |
|
Кор
Участник
IceICQ:12826
licq:2826
|
|
redline
Участник
w.d. lab™
licq:1122
|
|
Кор
Участник
IceICQ:12826
licq:2826
|
|
redline
Участник
w.d. lab™
licq:1122
|
отправлено: 08-09-2005 18:31:23 | |
инфо • правка • ссылка • сообщить модератору |
2 [Asm].Elk Это случаем не скрипт Зулу??? цитата: use uo; use os; include ":datafile:include/datafile"; include ":gumps:include/gumps"; include ":gumps:include/gumps_ex"; const UNCACHE_BTN := 0xF000000; const DEFAULT_CATEGORY := "None"; var data_file := DFOpenDataFile(":ai_brain:createnpc", DF_CREATE); program MakeNPC(who, template) if ( !template ) template := SelectFromGump(who); if ( !template ) return 0; endif endif var targ := TargetCoordinates(who); if ( !targ ) SendSysMessage(who, "Cancelled"); return 0; endif var npc := CreateNPCFromTemplate(template, targ.x, targ.y, targ.z, 0, who.realm); npc.facing := who.facing; if ( npc.errortext ) SendSysMessage(who, "Error creating NPC ["+template+"] -> "+npc.errortext); return 0; endif endprogram function SelectFromGump(who) var input := GFSendGump(who, RetrieveGump("Index")); if ( !input ) SendSysMessage(who, "Cancelled"); return 0; elseif ( input[UNCACHE_BTN] ) foreach elem_name in DFGetElemNames(data_file) data_file.DeleteElement(elem_name); sleepms(2); endforeach SendSysMessage(who, "All createnpc data uncached."); return 0; endif var category_names := GetCategoryNames(); input := GFSendGump(who, BuildNPCGump(category_names[input[0]])); if ( !input ) SendSysMessage(who, "Cancelled"); return 0; endif var elem_names := GetConfigStringKeys(ReadConfigFile("::npcdesc")); return elem_names[input[0]]; endfunction function RetrieveGump(category_name) if ( category_name == "Index" ) var data_elem := DFFindElement(data_file, "Index"); var gump := data_elem.GetProp("Gump"); if ( !gump ) gump := BuildIndexGump(); endif return gump; else var data_elem := DFFindElement(data_file, category_name); var gump := data_elem.GetProp("Gump"); if ( !gump ) gump := BuildNPCGump(category_name); endif return gump; endif endfunction function GetCategoryNames() var data_elem := DFFindElement(data_file, "Index"); var category_names := data_elem.GetProp("CategoryNames"); if ( !category_names ) category_names := SetupCategoryNames(); endif return category_names; endfunction function SetupCategoryNames() var category_names := (SortNPCs().keys()); var data_elem := DFFindElement(data_file, "Index", DF_CREATE); data_elem.SetProp("CategoryNames", category_names); return category_names; endfunction function BuildIndexGump() Set_Priority(100); var category_names := GetCategoryNames(); var data_elem := DFFindElement(data_file, "Index", DF_CREATE); data_elem.SetProp("CategoryNames", category_names); var bkgnd_silvertrim := GFCfgConst("BackGrounds", "SILVERTRIM"); var bkgnd_dark_stone := GFCfgConst("BackGrounds", "DARK_STONE"); var gump := GFCreateGump(); GFPage(gump, 0); GFResizePic(gump, 0, 0, bkgnd_silvertrim, 300, 480); GFResizePic(gump, 10, 10, bkgnd_dark_stone, 280, 460); var y_pos := 40; var counter := 1; var page_num := 1; GFTextMid(gump, 10, 15, 280, 2100, "NPC Categories"); ///// GFAddButton(gump, 158, 445, 4002, 4003, GF_CLOSE_BTN, UNCACHE_BTN); GFTextLine(gump, 193, 445, 2100, "Uncache data"); ///// GFPage(gump, page_num); foreach category_name in (category_names) GFAddButton(gump, 20, y_pos+3, 2117, 2118, GF_CLOSE_BTN, (_category_name_iter)); GFTextLine(gump, 40, y_pos, 2100, category_name); y_pos := y_pos+20; counter := counter+1; if ( counter > 20 ) counter := 1; y_pos := 40; GFAddButton(gump, 265, 445, 2648, 2649, GF_PAGE_BTN, page_num+1); page_num := page_num+1; GFPage(gump, page_num); GFAddButton(gump, 265, 15, 2650, 2651, GF_PAGE_BTN, page_num-1); endif sleepms(2); endforeach data_elem.SetProp("Gump", gump); return gump; endfunction function BuildNPCGump(category_name) Set_Priority(100); var npc_list := SortNPCs(); if ( !npc_list.Exists(category_name) ) //Nifty new trick below. return error{"errortext":="Category name does not exist."}; endif var data_elem := DFFindElement(data_file, Lower(category_name), DF_CREATE); npc_list := npc_list[category_name]; var bkgnd_silvertrim := GFCfgConst("BackGrounds", "SILVERTRIM"); var bkgnd_dark_stone := GFCfgConst("BackGrounds", "DARK_STONE"); var gump := GFCreateGump(); GFPage(gump, 0); GFResizePic(gump, 0, 0, bkgnd_silvertrim, 300, 480); GFResizePic(gump, 10, 10, bkgnd_dark_stone, 280, 460); var y_pos := 40; var counter := 1; var page_num := 1; GFTextMid(gump, 10, 15, 280, 2100, "NPC List - "+category_name); GFPage(gump, page_num); foreach template in (npc_list[category_name]) GFAddButton(gump, 20, y_pos+3, 2117, 2118, GF_CLOSE_BTN, template.pos); GFTextLine(gump, 40, y_pos, template.color, template.name); y_pos := y_pos+20; counter := counter+1; if ( counter > 21 ) counter := 1; y_pos := 40; GFAddButton(gump, 265, 445, 2648, 2649, GF_PAGE_BTN, page_num+1); page_num := page_num+1; GFPage(gump, page_num); GFAddButton(gump, 265, 15, 2650, 2651, GF_PAGE_BTN, page_num-1); endif sleepms(2); endforeach data_elem.SetProp("Gump", gump); return gump; endfunction function SortNPCs() var data_elem := DFFindElement(data_file, "Index", DF_CREATE); var categories := data_elem.GetProp("NPCListSorted"); if ( categories ) return categories; endif var npc_config := ReadConfigFile("::npcdesc"); var cfg_keys := GetConfigStringKeys(npc_config); categories := dictionary; categories[DEFAULT_CATEGORY] := array{}; foreach template_name in (cfg_keys) var cfg_elem := npc_config[template_name]; var template := struct; template.+name :=template_name; template.+pos :=_template_name_iter; template.+color :=GetNameColor(npc_config[template_name].alignment); if ( !cfg_elem.category ) categories[DEFAULT_CATEGORY].append(template); else if ( Lower(TypeOf(categories[cfg_elem.category])) != "array" ) categories[cfg_elem.category] := array{}; endif categories[cfg_elem.category].append(template); endif sleepms(2); endforeach // This function is time consuming.. so its results get saved. data_elem.SetProp("NPCListSorted", categories); return categories; endfunction function GetNameColor(reputation) var reputation_cfg := ReadConfigFile("::repsys"); //We know the config is there - core won't start without it. var reputation_elem := reputation_cfg["NameColoring"]; if ( !reputation_elem ) /* * In most shards the config is setup as * NameColoring * { * // Information here * } * **---=[! Needs to be changed to !]=---** * NameColoring NameColoring * { * //Information here * } */ SysLog("Unable to read in repsys.cfg elem [NameColoring] ->"+reputation_elem.errortext); SysLog("You probably don't have an elem name set for it. Thats naughty!"); return 0; endif case ( reputation ) "good": return (GetConfigInt(reputation_elem, "innocent")-1); "neutral": return (GetConfigInt(reputation_elem, "attackable")-1); "evil": return (GetConfigInt(reputation_elem, "murderer")-1); // No alignment for an npc is considered neutral default: return (GetConfigInt(reputation_elem, "attackable")-1); endcase endfunction |
|
IP |
|
-kr1k-
Участник
Peace->doo->ball
licq:1294
|
отправлено: 08-09-2005 22:46:52 | |
инфо • правка • ссылка • сообщить модератору |
проф , я конечно понемаю что мы тя уже все задолбали , но насколько сделан серв , и когда примерно ты его запустишь? |
|
IP |
|
Prof
Участник
•resurreXi¤n•
licq:1840
|
|
[Asm].ELK
Участник
Водка пить, земля валяться
licq:1150
|
|
Prof
Участник
•resurreXi¤n•
licq:1840
|
|
Prof
Участник
•resurreXi¤n•
licq:1840
|
|
Prof
Участник
•resurreXi¤n•
licq:1840
|
|
Кор
Участник
IceICQ:12826
licq:2826
|
|
-kr1k-
Участник
Peace->doo->ball
licq:1294
|
отправлено: 27-09-2005 22:58:54 | |
инфо • правка • ссылка • сообщить модератору |
пиииииипл хелп как сделать шанс выпадения вещи из монстра? версия сферы 0.51а
Сообщение изменено -kr1k- от Tue Sep 27 23:00:01 2005 |
|
IP |
|
|