本文整理汇总了C#中Server.Mobile.Resurrect方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.Resurrect方法的具体用法?C# Mobile.Resurrect怎么用?C# Mobile.Resurrect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.Resurrect方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Refresh
public void Refresh( Mobile mob, Container cont )
{
if ( !mob.Alive )
{
mob.Resurrect();
DeathRobe robe = mob.FindItemOnLayer( Layer.OuterTorso ) as DeathRobe;
if ( robe != null )
robe.Delete();
if ( cont is Corpse )
{
Corpse corpse = (Corpse) cont;
for ( int i = 0; i < corpse.EquipItems.Count; ++i )
{
Item item = corpse.EquipItems[i];
if ( item.Movable && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.IsChildOf( mob.Backpack ) )
mob.EquipItem( item );
}
}
}
mob.Hits = mob.HitsMax;
mob.Stam = mob.StamMax;
mob.Mana = mob.ManaMax;
mob.Poison = null;
}
示例2: ResurrectPlayers
public static void ResurrectPlayers(string arglist, Mobile triggermob, object refobject, out string status_str)
{
status_str = null;
Item refitem = null;
Mobile refmob = null;
if (refobject is Item)
{
refitem = (Item)refobject;
}
else
if (refobject is Mobile)
{
refmob = (Mobile)refobject;
}
// syntax is RESURRECT[,range][,PETS]
// look for the range arg
string[] str = ParseString(arglist, 3, ",");
int range = 0;
bool petres = false;
if (str.Length > 1)
{
try
{
range = int.Parse(str[1]);
}
catch { status_str = "bad range arg in RESURRECT"; }
}
if (str.Length > 2)
{
// get the range arg
if (str[2] == "PETS")
{
petres = true;
}
}
try
{
if ((range > 0) || (triggermob != null && !triggermob.Deleted))
{
// resurrect all players within range if range is > 0
if (range > 0)
{
IPooledEnumerable rangelist = null;
if (refitem != null && !refitem.Deleted)
{
rangelist = refitem.GetMobilesInRange(range);
}
else if (refmob != null && !refmob.Deleted)
{
rangelist = refmob.GetMobilesInRange(range);
}
if (rangelist != null)
{
foreach (Mobile p in rangelist)
{
if (!petres && p is PlayerMobile && p.Body.IsGhost)
{
p.Resurrect();
}
else if (petres && p is BaseCreature && ((BaseCreature)p).ControlMaster == triggermob && ((BaseCreature)p).Controlled && ((BaseCreature)p).IsDeadPet)
{
((BaseCreature)p).ResurrectPet();
}
}
rangelist.Free();
}
}
else
{
// just send it to the mob who triggered
if (triggermob.Body.IsGhost)
triggermob.Resurrect();
}
}
}
catch { }
}
示例3: LeaveGame
public void LeaveGame( Mobile m )
{
CTFTeam t = GetTeam( m );
if ( t != null )
t.RemoveMember( m );
if ( m.AccessLevel == AccessLevel.Player && !m.Blessed )
{
if ( m.Alive )
{
m.Kill();
if ( m.Corpse != null && !m.Corpse.Deleted )
m.Corpse.Delete();
}
m.Resurrect();
}
Item robe = m.FindItemOnLayer( Layer.OuterTorso );
if ( robe is CTFRobe )
robe.Delete();
if ( m.Backpack != null )
{
Item[] robes = m.Backpack.FindItemsByType( typeof( CTFRobe ) );
for(int i=0;i<robes.Length;i++)
robes[i].Delete();
}
m.Delta( MobileDelta.Noto );
}
示例4: UseGate
public override void UseGate( Mobile m )
{
OptimizeItemsList();
// Murderers are not allowed to use the gate.
if ( m.Kills >= 5 )
{
m.SendLocalizedMessage( 1019004 );
}
// If you cast a spell, you are too busy to use the gate.
else if ( m.Spell != null )
{
m.SendLocalizedMessage( 1049616 );
}
else if ( m_PlayerCountMax <= m_PlayersPassed && m_PlayerCountLimited )
{
m.SendMessage( m_PlayerCountExeededMessage );
}
else
{
if (_ChangesStats)
{
m.Str = this.m_Str;
m.Dex = this.m_Dex;
m.Int = this.m_Int;
}
if (_DoesResurrect && !m.Alive)
{
// THIS PART IS FOR "PERMADEATH" SHARDS...(or Semi-Permanent)
// We (optionally) rename the character to show that the original
// character 'died' and the new one takes their place.
// Essentially, the 'New' character is like a child, who must start new
// but inherits the property of the parent.
if (_DoesRename)
{
string nam = m.Name;
int last = nam.Length;
if (nam.Substring(last-2,2) == " I") nam = nam + "I";
else if (nam.Substring(last-3,3) == " II") nam = nam + "I";
else if (nam.Substring(last-3,3) == "III") nam = nam.Substring(0,last-2) + "V";
else if (nam.Substring(last-2,2) == "IV") nam = nam.Substring(0,last-2) + "V";
else if (nam.EndsWith(" V"))
{
if ( m.Female )
nam = NameList.RandomName( "female" );
else
nam = NameList.RandomName( "male" );
}
else nam = nam + " II";
m.Name = nam;
}
m.Resurrect();
}
if (_DoesTeleport)
{
m.Map = this.TargetMap;
m.Location = this.Target;
}
if (_ChangesSkills)
{
Server.Skills skills = m.Skills;
for ( int i = 0; i < skills.Length; ++i ) skills[i].Base = gAllSkills[i];
}
if (_ChangesCaps)
{
Server.Skills skills = m.Skills;
for ( int i = 0; i < skills.Length; ++i ) skills[i].Cap = gAllSkillCaps[i];
}
if (_ChangesHue) m.Hue = this.Hue;
if (_SkillsGiveItems)
{
Server.Skills s = m.Skills;
for ( int i = 0; i < s.Length; ++i )
if (gAllSkills[i] >= _SkillsItemsMin)
SkillsItems((SkillName)i, m);
}
if (m_TitleAdds)
{
m.Title = this.m_TitleToAdd;
}
//TODO: Create Method for how the Gate knows that you previously passed through...
if ( m_TakesBackGivenItems )
{
if ( MC_ItemsToGive.Count > 0 )
{
for( int i = 0; i < MC_ItemsToGive.Count; i++)
{
if (MC_ItemsToGive[i] is Item)
{
m.Backpack.ConsumeUpTo( ((Item)(MC_ItemsToGive[i])).GetType(), ((Item)(MC_ItemsToGive[i])).Amount );
}
}
//.........这里部分代码省略.........
示例5: ReDress
public static bool ReDress(Mobile m)
{
UndressedPlayer ud;
if ( !m_UndressedDictionary.TryGetValue(m, out ud) )
m.SendMessage("Unfortunately we could not find your belongings, please contact the staff.");
else
{
if ( !m.Alive )
m.Resurrect();
Container pack = m.Backpack;
if ( pack != null )
{
foreach ( Item item in ud.WornList )
{
if (!item.CanEquip(m) || !m.EquipItem(item))
m.AddToBackpack(item);
}
foreach (Item item in ud.BackPackList)
m.AddToBackpack(item);
if (ud.Bag.Items.Count == 0)
ud.Bag.Delete();
if (ud.PetList.Count > 0)
ReturnPets(m, ud);
m.SendMessage("Your belongings have been returned to you.");
m_UndressedDictionary.Remove(m);
return true;
}
else
m.SendMessage("Unfortunately we could not return your belongings, as you have no backpack, please contact the staff.");
}
return false;
}
示例6: Undress
public static bool Undress(Mobile m, Predicate<Item> pred)
{
if (!m.Alive)
{
m.Resurrect();
m.Hits = m.HitsMax;
}
if (m.Backpack != null)
{
Bag bag;
UndressedPlayer ud;
if (!m_UndressedDictionary.TryGetValue(m, out ud))
{
bag = new Bag();
m.BankBox.DropItem(bag);
ud = new UndressedPlayer(bag);
m_UndressedDictionary[m] = ud;
}
else
return false;
if (m.Holding != null)
m.Backpack.DropItem(m.Holding);
StablePets(m, ud);
for (int i = m.Items.Count - 1; i >= 0; --i)
{
Item item = (Item)m.Items[i];
if (Array.BinarySearch(m_ExcludedLayers, item.Layer) < 0)
{
if (pred == null || pred(item))
{
ud.WornList.Add(item);
bag.DropItem(item);
}
}
}
for (int i = m.Backpack.Items.Count; i > 0; i--)
{
Item item = m.Backpack.Items[i - 1];
if (pred == null || pred(item))
{
ud.BackPackList.Add(item);
bag.DropItem(item);
}
}
return true;
}
else
{
m.SendMessage("Unfortunately we could not undress you, as you have no backpack, please contact the staff.");
return false;
}
}
示例7: HandleMatchEnd
private void HandleMatchEnd(Mobile from, bool kick)
{
if(!from.Alive)
{
from.Resurrect();
if(from.Corpse != null && from.Corpse is Corpse)
{
Corpse c = (Corpse)from.Corpse;
for ( int i = 0; i < c.Items.Count; ++i )
{
Item item = c.Items[i];
c.SetRestoreInfo( item, item.Location );
}
c.Open(from, true);
c.Delete();
}
}
from.Criminal = false;
from.Blessed = false;
from.Frozen = false;
from.CurePoison(from);
from.StatMods.Clear();
from.Hits = from.HitsMax;
from.Mana = from.ManaMax;
from.Stam = from.StamMax;
Targeting.Target.Cancel( from );
from.MagicDamageAbsorb = 0;
from.MeleeDamageAbsorb = 0;
ProtectionSpell.Registry.Remove( from );
DefensiveSpell.Nullify( from );
from.Combatant = null;
from.Delta( MobileDelta.Noto ); //Update notoriety
from.Location = m_SpectatorDest;
if(kick && from.NetState == null)
{
Match m = FindMatch(from);
if(m.Attackers.Contains(from))
m.Attackers.Remove(from);
else if(m.Defenders.Contains(from))
m.Defenders.Remove(from);
}
}
示例8: PrepFighter
private void PrepFighter(Mobile from)
{
if(!from.Alive)
from.Resurrect();
if(from.Mount != null)
from.Mount.Rider = null;
from.CurePoison(from);
from.Blessed = true;
from.Frozen = true;
from.StatMods.Clear();
from.Hits = from.HitsMax;
from.Mana = from.ManaMax;
from.Stam = from.StamMax;
Targeting.Target.Cancel( from );
from.MagicDamageAbsorb = 0;
from.MeleeDamageAbsorb = 0;
ProtectionSpell.Registry.Remove( from );
DefensiveSpell.Nullify( from );
from.Combatant = null;
from.Delta( MobileDelta.Noto ); //Update notoriety
from.SendMessage("The fight will begin in ten seconds.");
}
示例9: FinalPrep
public void FinalPrep(Mobile from)
{
if(!from.Alive)
from.Resurrect();
from.CurePoison(from);
from.Blessed = false;
from.Frozen = false;
from.StatMods.Clear();
from.Hits = from.HitsMax;
from.Mana = from.ManaMax;
from.Stam = from.StamMax;
Targeting.Target.Cancel( from );
from.MagicDamageAbsorb = 0;
from.MeleeDamageAbsorb = 0;
ProtectionSpell.Registry.Remove( from );
DefensiveSpell.Nullify( from );
from.Combatant = null;
from.Delta( MobileDelta.Noto ); //Update notoriety
}
示例10: attrib
public void attrib(Mobile who)
{
PlayerMobile m = who as PlayerMobile;
RemoveRing(m);
m.Aggressed.Clear();
m.Aggressors.Clear();
if(!who.Alive)
who.Resurrect();
if(m.TempMount != null)
{
m.TempMount.Rider = m;
m.TempMount = null;
}
m.Criminal = false;
m.Warmode = false;
m.PlaySound( 0x214 );
m.FixedEffect( 0x376A, 10, 16 );
m.Hits = 125;
m.Mana = 125;
m.Stam = 125;
}
示例11: makeready
public void makeready(Mobile who)
{
PlayerMobile c = (PlayerMobile) who;
if( !who.Alive )
who.Resurrect();
Container bp = c.Backpack;
Container bankbag = new Bag();
bankbag.Hue = 63;
BankBox bank = c.BankBox;
Item oncurs = c.Holding;
if(oncurs != null)
bp.DropItem(oncurs);
c.SendMessage( "You have 10 seconds until the duel begins" );
c.SendMessage( 63, "After one of you dies, both of you will be teleported out" );
c.Criminal = true;
c.CurePoison(c);
c.Blessed = true;
c.Frozen = true;
c.Hits = c.HitsMax;
c.Mana = c.ManaMax;
c.Stam = c.StamMax;
c.StatMods.Clear();
if(bp != null)
{
Item toDisarm = c.FindItemOnLayer( Layer.OneHanded );
if ( toDisarm == null || !toDisarm.Movable )
toDisarm = c.FindItemOnLayer( Layer.TwoHanded );
if (toDisarm != null)
bp.DropItem(toDisarm);
if ( c.Mount != null )
{
IMount mount = c.Mount;
mount.Rider = null;
if( mount is BaseMount )
{
BaseMount oldMount = (BaseMount)mount;
oldMount.Map = Map.Internal;
c.TempMount = oldMount;
}
}
while((BasePotion)bp.FindItemByType(typeof(BasePotion)) != null)
{
BasePotion potion = (BasePotion)bp.FindItemByType(typeof(BasePotion));
bankbag.DropItem(potion);
}
while((EtherealMount)bp.FindItemByType(typeof(EtherealMount)) != null)
{
EtherealMount mount = (EtherealMount)bp.FindItemByType(typeof(EtherealMount));
bankbag.DropItem(mount);
}
/*Item[] weps = bp.FindItemsByType( typeof( BaseWeapon ) );
for ( int i = 0; i < weps.Length; ++i )
{
Item item = (Item)weps[i];
BaseWeapon weapon = item as BaseWeapon;
if( weapon.DamageLevel > WeaponDamageLevel.Regular )
bankbag.DropItem( item );
}*/
if( bankbag.Items.Count > 0 )
bank.DropItem(bankbag);
else
bankbag.Delete();
}
}