sahisahi

Member
Trying to make players gain double points if they are in Order/Chaos guild type:

This is what i added:


Code:
/////////////Guild type edit method 1///////////////////////
if (killer.GuildType.Order !=null && killed.GuildType.Chaos != null && killer.GuildType.Order != killed.GuildType.Chaos)
{ 
cval *= 2;
}
/////////////////////////////////////

Full method:

Code:
        public override void OnKill(Mobile killed, Mobile killer)
        {
            if (killer == null || killed == null || !(killed.Player) || killer == killed) return;

            bool awardpoints = true;

            // if this was a team or challenge duel then clear agressor list
            if (killed == m_Challenger || killer == m_Challenger || AreInSameGame(killed, killer))
            {
                // and remove the challenger from the aggressor list so that the res noto is not affected
                ClearAggression(killed, killer);
            }

            // handle challenge team kills
            if (ChallengeGame != null && !ChallengeGame.Deleted)
            {
                ChallengeGame.OnKillPlayer(killer, killed);
            }

            // check to see whether points can be given
            if (!(AttachedTo is Mobile) || !CanAffectPoints((Mobile)AttachedTo, killer, killed, false))
            {
                awardpoints = false;
            }

            // if this was a challenge duel then clear the challenger field
            if (killed == m_Challenger || killer == m_Challenger)
            {
                m_Challenger = null;
            }

            // begin the section to award points

            if (!awardpoints) return;

            if (LogKills)
            {
                try
                {
                    using (StreamWriter op = new StreamWriter("kills.log", true))
                    {
                        op.WriteLine("{0}: {1} killed {2}", DateTime.Now, killer, killed);
                    }
                }
                catch { }
            }

            int killedpoints = 0;
            // give the killer his points, either a fixed amount or scaled by the difference with the points of the killed
            // if the killed has more points than the killed then gain more
            ArrayList list = XmlAttach.FindAttachments(killed, typeof(XmlPoints));

            if (list != null && list.Count > 0)
            {
                killedpoints = ((XmlPoints)list[0]).Points;
            }

            int val = (int)((killedpoints - Points) * m_WinScale);
            if (val <= 0) val = 1;

            Points += val;

            int cval = (int)((killedpoints - Points) * m_CreditScale);
            if (cval <= 0) cval = 1;

            Credits += cval;

            m_LastKill = DateTime.Now;

            killer.SendMessage(String.Format(Text(100215), val, killed.Name));  // "You receive {0} points for killing {1}"

            if (GainHonorFromDuel)
            {
                bool gainedPath = false;
                if (VirtueHelper.Award(killer, VirtueName.Honor, val, ref gainedPath))
                {
                    if (gainedPath)
                    {
                        killer.SendLocalizedMessage(1063226); // You have gained a path in Honor!
                    }
                    else
                    {
                        killer.SendLocalizedMessage(1063225); // You have gained in Honor.
                    }
                }
            }

/////////////Guild type edit method 1///////////////////////
if (killer.GuildType.Order !=null && killed.GuildType.Chaos != null && killer.GuildType.Order != killed.GuildType.Chaos)
{ 
cval *= 2;
}

/////////////////////////////////////



            // add to the recently killed list
            //KillList.Add(new KillEntry(killed, DateTime.Now));

            // add to the cumulative death count
            Kills++;

            // update the overall ranking list
            UpdateRanking(killer, this);

            // if broadcast is enabled then announce it
            if (Broadcast && m_SystemBroadcast)
            {
                BroadcastMessage(AccessLevel.Player, 2569, String.Format(SystemText(100216), killer.Name, killed.Name));  // "{0} has defeated {1} in combat."
            }

            // update the points gump if it is open
            if (killer.HasGump(typeof(PointsGump)))
            {
                // redisplay it with the new info
                OnIdentify(killer);
            }

            // update the top players gump if it is open
            if (killer.HasGump(typeof(TopPlayersGump)))
            {
                killer.CloseGump(typeof(TopPlayersGump));
                killer.SendGump(new TopPlayersGump(this));
            }
        }


Errors:

CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 2021: 'Server.Mobile' does not contain a definition for 'GuildT
ype' and no extension method 'GuildType' accepting a first argument of type 'Ser
ver.Mobile' could be found (are you missing a using directive or an assembly ref
erence?)


tried a differnt approach:


Code:
if (killer.GuildType.Order !=null && killed.GuildType.Chaos != null && killer.GuildType.Order != killed.GuildType.Chaos)
{ 
cval *= 2;
}

Errors:

CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cann
ot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cann
ot be used like a method.


thanks....
 
Trying to make players gain double points if they are in Order/Chaos guild type:
Errors:
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cannot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cannot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Order' cannot be used like a method.
CS1955: Line 2026: Non-invocable member 'Server.Guilds.GuildType.Chaos' cannot be used like a method.
thanks....
What file are you editing (Notoriety, Playermobile)?
We're talking Order/Chaos OSI, or Order/Chaos XmlFactions?
 
Im editing xmlpoints.cs

We're talking Order/Chaos OSI, or Order/Chaos XmlFactions?
No, im using the order and chaos system that got removed with AOS if i recall good.

Someone asked in xmlspawner forums how to give double points between faction kills

this is what ArteGordon said:


Code:
             if (Faction.Find(killer) !=null && Faction.Find(killed) != null && Faction.Find(killer) != Faction.Find(killed))
{
  cval *= 2;
}

Well my server DOESNT HAVE factions, but it have Order & Chaos guildtype:

I made a moongate for chaos members only:



Code:
public override void OnDoubleClick( Mobile from )
        {
            Guild guild = from.Guild as Guild;
            if (! from.InRange( GetWorldLocation(), 1 ))
            {
                from.SendMessage( "Estas demasiado lejos" ); // That is too far away.
                return;
            }

if (guild != null && from is PlayerMobile && from.Guild.Type == GuildType.Regular)
{  
from.SendMessage( "Neutral members cant not join" );
return;
}
if (guild != null && from is PlayerMobile && from.Guild.Type == GuildType.Order)
{  
from.SendMessage( "Order Memebrs cant not join" );
return;
}
        if ( from.Criminal )
            {
                from.SendAsciiMessage( "Thou'rt a criminal and cannot escape so easily., ", 0x22 ); 
                return;
            }
            else if ( SpellHelper.CheckCombat( from ) )
            {
                from.SendAsciiMessage( "Wouldst thou flee during the heat of battle??", 0x22 ); // Wouldst thou flee during the heat of battle??
                return;
            }
            else if ( from.Spell != null )
            {
                from.SendAsciiMessage( "You are too busy to do that at the moment." ); // You are too busy to do that at the moment.
                return;
            }
            else
            {
if (guild != null && from is PlayerMobile && from.Guild.Type == GuildType.Chaos)
{  
       from.Location = new Point3D( 381,133,33 );
         from.Map = Map.Malas;
         from.SendAsciiMessage( "Entras a la Mazmorra Exclusiva para Faccion Chaos, buena caza." );
        }
        }
        }

So i wonder if theres a way.. to give double xmlpoints between chaos and order members.
 
Last edited:
Try Guild.Type, instead of GuildType

Nothing, errors:


Code:
if (killer.Guild.Type.Order !=null && killed.Guild.Type.Chaos != null && killer.Guild.Type.Order != killed.Guild.Type.Chaos)
{  
cval *= 2;
}

CS0176: Line 2024: Member 'Server.Guilds.GuildType.Order' cannot be accessed
with an instance reference; qualify it with a type name instead
CS0176: Line 2024: Member 'Server.Guilds.GuildType.Chaos' cannot be accessed
with an instance reference; qualify it with a type name instead
CS0176: Line 2024: Member 'Server.Guilds.GuildType.Order' cannot be accessed
with an instance reference; qualify it with a type name instead
CS0176: Line 2024: Member 'Server.Guilds.GuildType.Chaos' cannot be accessed
with an instance reference; qualify it with a type name instead



Code:
if (Guild.Type.Order(killer) !=null && Guild.Type.Chaos(killed) != null && Guild.Type.Order(killer) != Guild.Type.Chaos(killed))
{   
cval *= 2;
}


CS0120: Line 2029: An object reference is required for the non-static field,
method, or property 'Server.Guilds.BaseGuild.Type.get'
CS0120: Line 2029: An object reference is required for the non-static field,
method, or property 'Server.Guilds.BaseGuild.Type.get'
CS0120: Line 2029: An object reference is required for the non-static field,
method, or property 'Server.Guilds.BaseGuild.Type.get'
CS0120: Line 2029: An object reference is required for the non-static field,
method, or property 'Server.Guilds.BaseGuild.Type.get'
 
you could try this one
Code:
if (killer.Guild != null && killed.Guild != null && killer.Guild.Type != Guilds.GuildType.Regular && killed.Guild.Type != Guilds.GuildType.Regular && killer.Guild.Type != killed.Guild.Type)
 
you could try this one
Code:
if (killer.Guild != null && killed.Guild != null && killer.Guild.Type != Guilds.GuildType.Regular && killed.Guild.Type != Guilds.GuildType.Regular && killer.Guild.Type != killed.Guild.Type)

That looks like its going to work :p, going to test now

one question why is there the Regular (Neutral) guild type?
 
because you do just want to see if they are either in order or chaos, and at the end you see if they are not both order or both chaos :p at least thats how I understood how you wanted it
 
Because the other "types" are Order and Chaos, but this pertains to the older guild system. All AOS+ guilds are "regular" but Pre aos they can be either Regular, Order, or Chaos. Hope that makes sense.
[doublepost=1486834205][/doublepost]
because you do just want to see if they are either in order or chaos, and at the end you see if they are not both order or both chaos :p at least thats how I understood how you wanted it

PyrO beat me to it.
 
Ahhh i see, nice double reply, you both are synced

I dont know maybe i explained myself wrong i wanted:

If killer is order and killed chaos give bonus points

If killer is chaos and killed order give bonus points

If killer is neutral and killed order no bonus points

If killer is neutral and killed chaos no bonus points

:p

Thanks!
 
Well for now it works like this:
if killer is order and killed is chaos, gives points
if killer is chaos and killed is order, gives points
if killer is order and killed is order doesnt give points
if killer is chaos and killed is chaos doesnt give points
if killer is neutral no points
if killed is neutral no points
if killer is in no guild no points and no crash
if killed is in no guild no points and no crash ;)
 
Well for now it works like this:
if killer is order and killed is chaos, gives points
if killer is chaos and killed is order, gives points
if killer is order and killed is order doesnt give points
if killer is chaos and killed is chaos doesnt give points
if killer is neutral no points
if killed is neutral no points
if killer is in no guild no points and no crash
if killed is in no guild no points and no crash ;)

Thats the most important thing, hehe i was checking right now between player in guild and player with no guild


Thank you so much
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back