منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   كوستة SwordWar (https://code.vpscairo.com/showthread.php?t=499)

محمد ياسر 2019-06-21 10:25 AM

كوستة SwordWar
 

الكويستة عبارة بتخش الماب بتلاقى سورد بينزل على الاعب

بيائثر بقليل بس بيعمل شكل كويس


اونلا نفتح ملف npc.cs
ونضيف الانبى سهات دى
كود PHP:

#region SwordsWar 
                #region Join 
                
case 16420u
                    { 
                        switch (
npcRequest.OptionID
                        { 
                            case 
0
                                
dialog.Text("Hello " client.Entity.Name "I'm the master of the swords war .. I can teleport you in but be carefull my swords are flying everywhere inside !"); 
                                
dialog.Option("Let me join"1); 
                                
dialog.Option("No i'm scared"255); 
                                
dialog.Send(); 
                                break; 
                            case 
1
                                if (
World.SwardWar
                                { 
                                    
client.Entity.Teleport(64205050); 
                                    break; 
                                } 
                                
dialog.Text("This is not the right time..Come back at xx:50"); 
                                
dialog.Option("okay"255); 
                                
dialog.Send(); 
                                break; 

                        } 
                        break; 
                    } 
                
#endregion 
                 
                #region Out 
                
case 164210
                    { 
                        switch (
npcRequest.OptionID
                        { 
                            case 
0
                                { 
                                    
int num117 0
                                    
GameClient[] array3 Program.GamePool
                                    for (
int l 0array3.Lengthl++) 
                                    { 
                                        
GameClient gameClient10 array3[l]; 
                                        if (
gameClient10.Entity.MapID == 6420 && !gameClient10.Entity.Dead
                                        { 
                                            
num117++; 
                                        } 
                                    } 
                       
                                    
dialog.Text(string.Concat(new object[] 
                                            { 
                                                
"Hello "
                                                
client.Entity.Name
                                                
" there Are "
                                                
num117
                                                
" alive Player" 
                                            
})); 
                                    
dialog.Option("I want to claim my prize "1); 
                                    
dialog.Send(); 
                                    break; 
                                } 
                            case 
1
                                { 
                                    if (
World.SwardWar
                                    { 
                                        
dialog.Text("This is not the right time \nCome back at xx:00"); 
                                        
dialog.Option("okay"255); 
                                        
dialog.Send(); 
                                        break; 
                                    } 
                                    
int num118 0
                                    
GameClient[] array3 Program.GamePool
                                    for (
int l 0array3.Lengthl++) 
                                    { 
                                        
GameClient gameClient11 array3[l]; 
                                        if (
gameClient11.Entity.MapID == 6420 && !gameClient11.Entity.Dead
                                        { 
                                            
num118++; 
                                        } 
                                    } 
                                    if (
num118 == 1
                                    { 
                                        
client.Entity.Teleport(1002301278); 
                                     
//   client.Entity.BigBOS_Quest_Reward_Point += 1u; 
//uint prize = questini.ReadUInt32("Quests", "Hour"); 
                                        
client.Entity.ConquerPoints += 50000
                                        
ServerBase.Kernel.SendWorldMessage(new Message("Gratz " client.Entity.Name "You Wenner Quest Sward War Prize 1 M CPs."System.Drawing.Color.BlackMessage.Center), Program.GamePool); 
                                        break; 
                                    } 
                                    
dialog.Text("There are " num118 "player alive In map"); 
                                    
dialog.Option("okay"255); 
                                    
dialog.Send(); 
                                    break; 
                                } 

                        } 
                        break; 
                    } 
                
#endregion 
                #endregion 

نفتح ملف
world.cs
ونبحث عن
كود PHP:

 public class World 
    


ضيف دا تحتها
كود PHP:

 public static bool SwardWar false

ونضيف دا تحت اى ايفنت عندك فى world
كود PHP:

    #region SwardWar 
            
if (DateTime.Now.Minute == 50 && DateTime.Now.Second == 1
            { 
                
World.SwardWar true
                
GameClient[] gamePool6 Program.GamePool
                for (
int n 0gamePool6.Lengthn++) 
                { 
                    
GameClient gameClient6 gamePool6[n]; 
                    
gameClient6.MessageBox("Sward War IS Work Join Now  and Get Houner And Get " 25000000 " CPS "delegate(GameClient p
                    { 
                        
p.Entity.Teleport(1002294366); 
                    }, 
null0u); 
                } 
                
NpcTyps.addeffect(16420u); 
            } 
            if (
DateTime.Now.Minute == && World.SwardWar
            { 
                
World.SwardWar false
                
NpcTyps.removeEffect(16420u); 
            } 
            
#endregion 

ونعمل ملف بالاسم دا

NpcTyps.cs
ونضيف دا فية
كود PHP:

using Conquer_Online_Server.Client
using Conquer_Online_Server.Interfaces
using System
namespace 
Conquer_Online_Server.Game.BigBOs 

    public class 
NpcTyps 
    

        public 
enum GetNpc 
        

            
SwardWar 16420
        } 
        private static 
string Effect1 "fire-bomb_1"
        private static 
string Effect2 "attach_continuance05"
        private static 
string Effect3 "attach_continuance05"
        private static 
string Effect4 "attach_continuance05"
        private static 
string Effect5 "attach_continuance05"
        private static 
string Effect6 "tj-long"
        public static 
string GetEffect() 
        { 
            
Random random = new Random(); 
            
int num random.Next(16); 
            
string result ""
            switch (
num
            { 
                case 
1
                    
result NpcTyps.Effect1
                    break; 
                case 
2
                    
result NpcTyps.Effect2
                    break; 
                case 
3
                    
result NpcTyps.Effect3
                    break; 
                case 
4
                    
result NpcTyps.Effect4
                    break; 
                case 
5
                    
result NpcTyps.Effect5
                    break; 
                case 
6
                    
result NpcTyps.Effect6
                    break; 
            } 
            return 
result
        } 
        public static 
void addeffect(uint type
        { 
            if (
ServerBase.Kernel.Maps[1002].Npcs.ContainsKey(type)) 
            { 
                
INpc npc ServerBase.Kernel.Maps[1002].Npcs[type]; 
                
npc.effect NpcTyps.GetEffect(); 
                
ServerBase.Kernel.Maps[1002].Npcs.Remove(npc.UID); 
                
ServerBase.Kernel.Maps[1002].AddNpc(npc); 
                
GameClient[] gamePool Program.GamePool
                for (
int i 0gamePool.Lengthi++) 
                { 
                    
GameClient gameClient gamePool[i]; 
                    if (
gameClient.Entity.MapID == 1002
                    { 
                        
npc.SendSpawn(gameClient); 
                    } 
                } 
            } 
        } 
        public static 
void removeEffect(uint type
        { 
            if (
ServerBase.Kernel.Maps[1002].Npcs.ContainsKey(type)) 
            { 
                
INpc npc ServerBase.Kernel.Maps[1002].Npcs[type]; 
                
npc.effect ""
                
ServerBase.Kernel.Maps[1002].Npcs.Remove(npc.UID); 
                
ServerBase.Kernel.Maps[1002].AddNpc(npc); 
                
GameClient[] gamePool Program.GamePool
                for (
int i 0gamePool.Lengthi++) 
                { 
                    
GameClient gameClient gamePool[i]; 
                    if (
gameClient.Entity.MapID == 1002
                    { 
                        
npc.SendSpawn(gameClient); 
                    } 
                } 
            } 
        } 
    } 


ونعمل ملف بالاسم دا برضو

BigPlayers.cs

ونضيف دا فية
كود PHP:

using Conquer_Online_Server.Client
using Conquer_Online_Server.Database
using Conquer_Online_Server.Game
using Conquer_Online_Server.Network.GamePackets
using Conquer_Online_Server.ServerBase
using System
namespace 
Conquer_Online_Server 

    
internal class BigPlayers 
    

        public static 
void spwannpc(GameClient clientuint UIDushort Xushort Y
        { 
            
SobNpcSpawn sobNpcSpawn = new SobNpcSpawn(); 
            
sobNpcSpawn.UID UID
            
sobNpcSpawn.X
            
sobNpcSpawn.Y
            
sobNpcSpawn.Mesh 8910
            
sobNpcSpawn.Type Enums.NpcType.Talker
            
sobNpcSpawn.MapID 2057
            if (!
client.Map.Npcs.ContainsKey(UID)) 
            { 
                
client.Map.Npcs.Add(UIDsobNpcSpawn); 
            } 
        } 
        public static 
void thundereffect(GameClient clientuint uid
        { 
            
client.SendScreen(new _String(true
            { 
                
UID uid
                
TextsCount 22
                
Type 10
                
Texts =  
                { 
                    
"ssch_wlhd_hit" 
                

            }, 
true); 
        } 
        public static 
void SpwanKing(GameClient clientstring nameushort meshushort xushort yushort MapIDushort actionuint uiduint Gramntsuint RightHanduint LeftHanduint righthand0uint lefthand0ushort GuildIDbyte Class) 
        { 
            try 
            { 
                
Entity.damge1 0u
                
Entity.damge2 0u
                
_String @string = new _String(true); 
                @
string.UID 810u
                @
string.TextsCount 22
                @
string.Type 10
                @
string.Texts.Add("ssch_wlhd_hit"); 
                
client.SendScreen(@stringtrue); 
                
MonsterInformation monsterInformation = new MonsterInformation(); 
                
monsterInformation.Hitpoints 200000u
                
monsterInformation.Level 200
                
monsterInformation.Mesh mesh
                
monsterInformation.Name name
                
monsterInformation.MaxAttack 80000u
                
monsterInformation.AttackRange 3
                
monsterInformation.AttackType 2
                
monsterInformation.AttackSpeed 2000
                
monsterInformation.ViewRange 15
                
monsterInformation.MoveSpeed 2000
                
monsterInformation.RunSpeed 500
                
monsterInformation.MinAttack 10000u
                
monsterInformation.InSight 0u
                
Entity entity = new Entity(EntityFlag.Monsterfalse); 
                
Entity.UpdateDamage(cliententity0u0u); 
                
entity.MagicDefence 2600
                
entity.MapObjType MapObjectType.Monster
                
entity.MonsterInfo monsterInformation
                
entity.MonsterInfo.Owner entity
                
entity.Name name
                
entity.MinAttack monsterInformation.MinAttack
                
entity.MaxAttack = (entity.MagicAttack monsterInformation.MaxAttack); 
                
entity.Hitpoints = (entity.MaxHitpoints monsterInformation.Hitpoints); 
                
entity.Body monsterInformation.Mesh
                
entity.Level monsterInformation.Level
                
entity.Defence 65535
                
entity.x
                
entity.Action action
                
entity.y
                
entity.bornx x
                
entity.borny y
                
entity.Gramnts Gramnts
                
entity.CountryFlagmob 15u
                
entity.HairStyle 514
                
entity.Facing Kernel.GetAngle(xyclient.Entity.Xclient.Entity.Y); 
                
entity.Amount 729828u
                
entity.Amounts 300000u
                
entity.Class = Class; 
                
entity.EntityFlag EntityFlag.Monster
                
entity.UID uid
                
entity.MapID MapID
                if (
name == "Ra.One Great Assessin"
                { 
                    
entity.AssassinBP 300u
                } 
                
entity.RightHand RightHand
                
entity.LeftHand LeftHand
                
entity.RightHand0 righthand0
                
entity.LeftHand0 lefthand0
                
entity.SendUpdates true
                
entity.GuildID GuildID
                
entity.GuildRank 990
                
client.Map.RemoveEntity(entity); 
                
_String string2 = new _String(true); 
                
string2.UID monsterInformation.ID
                
string2.Type 10
                
string2.Texts.Add("MBStandard"); 
                
client.Map.AddPlayer(entity); 
                if (
name == "Great Assessin"
                { 
                    
entity.AddFlag3(131072u); 
                } 
                
client.Entity.Owner.Screen.Reload(null); 
                @
string.UID uid
                @
string.TextsCount 1
                @
string.Type 10
                @
string.Texts.Add("ssch_wlhd_hit"); 
                
entity.MonsterInfo.SendScreen(@string); 
                
entity.MonsterInfo.SendScreen(@string); 
            } 
            catch (
Exception line
            { 
                
Console.WriteLine(line); 
            } 
        } 
        public static 
void Title(GameClient clientbyte title
        { 
            
TitlePacket titlePacket = new TitlePacket(true); 
            
client.Entity.MyTitle = (TitlePacket.Titles)title
            
titlePacket.Identifier client.Entity.UID
            
titlePacket.Type TitlePacket.Types.List; 
            
titlePacket.Count 1
            
titlePacket.Send(client); 
            
client.SendScreen(client.Entity.SpawnPacketfalse); 
        } 
        public static 
void SpwanSword(GameClient client
        { 
            
SpellUse spellUse = new SpellUse(true); 
            
spellUse.Attacker 16421u
            
spellUse.SpellID 10500
            
spellUse.66
            
ushort num 0
            if (
Program.Effect1.AddSeconds(2.0) < DateTime.Now
            { 
                for (
int i 014i++) 
                { 
                    
spellUse.= ((ushort)(34 num)); 
                    
num += 3
                    
client.SendScreen(spellUsetrue); 
                    if (
client.Entity.== spellUse.&& client.Entity.== spellUse.Y
                    { 
                        
client.Entity.Hitpoints -= 20u client.Entity.MaxHitpoints 100u
                    } 
                } 
                
Program.Effect1 DateTime.Now
            } 
            
num 0
            
spellUse.50
            if (
Program.Effect2.AddSeconds(5.0) < DateTime.Now
            { 
                for (
int j 014j++) 
                { 
                    
spellUse.= ((ushort)(34 num)); 
                    
num += 3
                    
client.SendScreen(spellUsetrue); 
                    if (
client.Entity.== spellUse.&& client.Entity.== spellUse.Y
                    { 
                        
client.Entity.Hitpoints -= 20u client.Entity.MaxHitpoints 100u
                    } 
                } 
                
Program.Effect2 DateTime.Now
            } 
            
num 0
            
spellUse.39
            if (
Program.Effect3.AddSeconds(8.0) < DateTime.Now
            { 
                for (
int k 014k++) 
                { 
                    
spellUse.= ((ushort)(34 num)); 
                    
num += 3
                    
client.SendScreen(spellUsetrue); 
                    if (
client.Entity.== spellUse.&& client.Entity.== spellUse.Y
                    { 
                        
client.Entity.Hitpoints -= 20u client.Entity.MaxHitpoints 100u
                    } 
                } 
                
Program.Effect3 DateTime.Now
            } 
            
num 0
            
spellUse.44
            if (
Program.Effect4.AddSeconds(11.0) < DateTime.Now
            { 
                for (
int l 014l++) 
                { 
                    
spellUse.= ((ushort)(31 num)); 
                    
num += 3
                    
client.SendScreen(spellUsetrue); 
                    if (
client.Entity.== spellUse.&& client.Entity.== spellUse.Y
                    { 
                        
client.Entity.Hitpoints -= 20u client.Entity.MaxHitpoints 100u
                    } 
                } 
                
Program.Effect4 DateTime.Now
            } 
            
num 0
            
spellUse.55
            if (
Program.Effect5.AddSeconds(14.0) < DateTime.Now
            { 
                for (
int m 014m++) 
                { 
                    
spellUse.= ((ushort)(31 num)); 
                    
num += 3
                    
client.SendScreen(spellUsetrue); 
                    if (
client.Entity.== spellUse.&& client.Entity.== spellUse.Y
                    { 
                        
client.Entity.Hitpoints -= 20u client.Entity.MaxHitpoints 100u
                    } 
                } 
                
Program.Effect5 DateTime.Now
            } 
            
num 0
            
spellUse.66
            if (
Program.Effect5.AddSeconds(17.0) < DateTime.Now
            { 
                for (
int n 014n++) 
                { 
                    
spellUse.= ((ushort)(num 31)); 
                    
num += 3
                    
client.SendScreen(spellUsetrue); 
                    if (
client.Entity.== spellUse.&& client.Entity.== spellUse.Y
                    { 
                        
client.Entity.Hitpoints -= 20u client.Entity.MaxHitpoints 100u
                    } 
                } 
                
Program.Effect6 DateTime.Now
            } 
        } 
        public static 
void SpwanGuildP(Map mapstring nameushort meshushort xushort yushort MapIDushort actionuint uiduint Gramntsuint RightHanduint LeftHanduint righthand0uint lefthand0ushort GuildIDbyte Class) 
        { 
            try 
            { 
                
_String @string = new _String(true); 
                @
string.UID 810u
                @
string.TextsCount 22
                @
string.Type 10
                @
string.Texts.Add("ssch_wlhd_hit"); 
                
GameClient[] gamePool Program.GamePool
                for (
int i 0gamePool.Lengthi++) 
                { 
                    
GameClient GameClient gamePool[i]; 
                    if (
GameClient.Entity.InTwinCity
                    { 
                        
GameClient.SendScreen(@stringtrue); 
                    } 
                } 
                
MonsterInformation monsterInformation = new MonsterInformation(); 
                
monsterInformation.Hitpoints 500000u
                
monsterInformation.Level 200
                
monsterInformation.Mesh mesh
                
monsterInformation.Name name
                
monsterInformation.MaxAttack 80000u
                
monsterInformation.AttackRange 3
                
monsterInformation.AttackType 2
                
monsterInformation.AttackSpeed 1000
                
monsterInformation.ViewRange 15
                
monsterInformation.MoveSpeed 2000
                
monsterInformation.RunSpeed 500
                
monsterInformation.MinAttack 10000u
                
monsterInformation.InSight 0u
                
Entity entity = new Entity(EntityFlag.Monsterfalse); 
                
entity.MagicDefence 2600
                
entity.MapObjType MapObjectType.Monster
                
entity.MonsterInfo monsterInformation
                
entity.MonsterInfo.Owner entity
                
entity.Name name
                
entity.MinAttack monsterInformation.MinAttack
                
entity.MaxAttack = (entity.MagicAttack monsterInformation.MaxAttack); 
                
entity.Hitpoints = (entity.MaxHitpoints monsterInformation.Hitpoints); 
                
entity.Body monsterInformation.Mesh
                
entity.Level monsterInformation.Level
                
entity.Defence 65535
                
entity.x
                
entity.Action action
                
entity.y
                
entity.bornx x
                
entity.borny y
                
entity.Gramnts Gramnts
                
entity.CountryFlagmob 15u
                
entity.HairStyle 514
                
entity.Facing Kernel.GetAngle(xyxy); 
                
entity.Amount 729828u
                
entity.Amounts 300000u
                
entity.Class = Class; 
                
entity.EntityFlag EntityFlag.Monster
                
entity.UID uid
                
entity.MapID MapID
                if (
name == "Assassin[PoleGuard]"
                { 
                    
entity.AssassinBP 300u
                } 
                
entity.RightHand RightHand
                
entity.LeftHand LeftHand
                
entity.RightHand0 righthand0
                
entity.LeftHand0 lefthand0
                
entity.SendUpdates true
                
entity.GuildID GuildID
                
entity.GuildRank 990
                
map.RemoveEntity(entity); 
                
_String string2 = new _String(true); 
                
string2.UID monsterInformation.ID
                
string2.Type 10
                
string2.Texts.Add("MBStandard"); 
                
map.AddPlayer(entity); 
                if (
name == "Assassin[PoleGuard]"
                { 
                    
entity.AddFlag3(131072u); 
                } 
                @
string.UID uid
                @
string.TextsCount 1
                @
string.Type 10
                @
string.Texts.Add("ssch_wlhd_hit"); 
                
entity.MonsterInfo.SendScreen(@string); 
                
entity.MonsterInfo.SendScreen(@string); 
            } 
            catch (
Exception line
            { 
                
Console.WriteLine(line); 
            } 
        } 
    } 


ونفتح Entity.cs
ونضيف فيها

كود PHP:

 public ushort bornx;  
        public 
ushort borny;  
        private 
uint _Gramnts;  
        private 
uint _Amount;  
        private 
uint _Amounts;  
        private 
uint _righthand;  
        private 
uint _leftHand;  
        private 
uint _righthand0;  
        private 
uint _leftHand0;  
        public 
uint _CountryFlag getset; }  
        public 
bool InTwinCity;  
        public 
uint RightHand  
        
{  
            
get  
            
{  
                return 
this._righthand;  
            }  
            
set  
            
{  
                
this._righthand value;  
                
Writer.WriteUInt32(value212this.SpawnPacket);  
            }  
        }  
        public 
uint LeftHand  
        
{  
            
get  
            
{  
                return 
this._leftHand;  
            }  
            
set  
            
{  
                
this._leftHand value;  
                
Writer.WriteUInt32(value208this.SpawnPacket);  
            }  
        }  
        public 
uint RightHand0  
        
{  
            
get  
            
{  
                return 
this._righthand0;  
            }  
            
set  
            
{  
                
this._righthand0 value;  
                
Writer.WriteUInt32(value64this.SpawnPacket);  
            }  
        }  
        public 
uint LeftHand0  
        
{  
            
get  
            
{  
                return 
this._leftHand0;  
            }  
            
set  
            
{  
                
this._leftHand0 value;  
                
Writer.WriteUInt32(value60this.SpawnPacket);  
            }  
        }  
        public 
uint CountryFlagmob  
        
{  
            
get  
            
{  
                return 
this._CountryFlag;  
            }  
            
set  
            
{  
                
this._CountryFlag value;  
                
Writer.WriteUInt32(value231this.SpawnPacket);  
            }  
        }  
        public 
uint Gramnts  
        
{  
            
get  
            
{  
                return 
this._Gramnts;  
            }  
            
set  
            
{  
                
this._Gramnts value;  
                
Writer.WriteUInt32(value52this.SpawnPacket);  
            }  
        }  
        public 
uint Amount  
        
{  
            
get  
            
{  
                return 
this._Amount;  
            }  
            
set  
            
{  
                
this._Amount value;  
                
Writer.WriteUInt32(value80this.SpawnPacket);  
            }  
        }  
        public 
uint Amounts  
        
{  
            
get  
            
{  
                return 
this._Amounts;  
            }  
            
set  
            
{  
                
this._Amounts value;  
                
Writer.WriteUInt32(value76this.SpawnPacket);  
            }  
        } 

و هنخش علي كلاس Map و نضيف فيه دا
كود PHP:

    public void AddPlayer(Entity entity)  
        {  
            if (((
Dictionary<uintEntity>)this.Entities).ContainsKey(entity.UID))  
                return;  
            
this.Entities.Add(entity.UIDentity);  
            
this.Floor[(int)entity.X, (int)entity.YMapObjectType.Monster, (object)entity] = false;  
        } 

و نخش علي Programs و نضيف دول
كود PHP:

public static DateTime Effect1;  
        public static 
DateTime Effect2;  
        public static 
DateTime Effect4;  
        public static 
DateTime Effect3;  
        public static 
DateTime Effect5;  
        public static 
DateTime Effect6

و نخش ع كلاس INpc و ضيف فية
كود PHP:

string effect getset; } 

ونفتح ملف npc فى نافى كات
كود PHP:

16420    0    0    SwordWar    2    40006    -1    1002    297    183    0    0    0    0    0    0    0    0    0    0    0    0        0    0    0    0    0     
164210    0    0    SwordWarWin    2    23100    
-1    6420    50    50    0    0    0    0    0    0    0    0    0    0    0    0        0    0    0    0    0 

وملف
maps

ونضيف فية
كود PHP:

6420    700    0    0 

انتهيت كده

Hassan Emprator 2019-06-25 02:02 AM

رد: كوستة SwordWar
 
مش فاهم اي فكرتها يعني بيخش بيلاقي سورد طيب اي الفايده كدا مش فاهم ؟

Hassan Emprator 2019-06-25 02:08 AM

رد: كوستة SwordWar
 
مش فاهم اي فكرتها يعني بيخش بيلاقي سورد طيب اي الفايده كدا مش فاهم ؟

MohamedModyAdel 2019-06-25 11:54 AM

رد: كوستة SwordWar
 
جميل جدا


الساعة الآن 09:46 PM

مرحبا بكم في منتدي اكواد لتطوير الالعاب