本文整理汇总了C#中WCell.RealmServer.Entities.GameObject类的典型用法代码示例。如果您正苦于以下问题:C# GameObject类的具体用法?C# GameObject怎么用?C# GameObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameObject类属于WCell.RealmServer.Entities命名空间,在下文中一共展示了GameObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Blastenheimer5000Used
private static bool Blastenheimer5000Used(GameObject go, Character user)
{
var cast = user.SpellCast;
cast.Start(CannonPrepId);
user.IncMechanicCount(SpellMechanic.Rooted);
switch (go.EntryId)
{
case (uint)Blastenheimer5000ElwynnId:
{
user.TeleportTo(ElwynnTelePosition, ElwynnTeleOrientation);
} break;
case (uint)Blastenheimer5000TerokkarId:
{
user.TeleportTo(TerokkarTelePosition, TerokkarTeleOrientation);
} break;
case (uint)Blastenheimer5000MulgoreId:
{
user.TeleportTo(MulgoreTelePosition, MulgoreTeleOrientation);
} break;
default:
{
user.DecMechanicCount(SpellMechanic.Rooted);
return false;
}
}
go.PlaySound(8476);
user.CallDelayed(2000, obj => FireCannon(user));
return true;
}
示例2: Apply
public override void Apply()
{
var goId = (GOEntryId)Effect.MiscValue;
var goEntry = GOMgr.GetEntry(goId);
var caster = m_cast.CasterUnit;
if (goEntry != null)
{
GO = goEntry.Spawn(caster, caster);
GO.State = GameObjectState.Enabled;
GO.Orientation = caster.Orientation;
GO.ScaleX = 1;
GO.Faction = caster.Faction;
GO.CreatedBy = caster.EntityId;
// TODO: Handle SummoningRitualHandler properly
if (GO.Handler is SummoningRitualHandler)
{
((SummoningRitualHandler)GO.Handler).Target = firstTarget;
}
if (m_cast.IsChanneling)
{
m_cast.CasterUnit.ChannelObject = GO;
}
else if (Effect.Spell.Durations.Min > 0)
{
// not channelled: Activate decay delay
GO.RemainingDecayDelayMillis = Effect.Spell.Durations.Random();
}
}
else
{
log.Error("Summoning Spell {0} refers to invalid Object: {1} ({2})", Effect.Spell, goId, (uint)goId);
}
}
示例3: WithdrawMoney
public void WithdrawMoney(Character withdrawer, GameObject bank, uint withdrawl)
{
if (withdrawl == 0) return;
if (!bank.CanInteractWith(withdrawer)) return;
if (withdrawer.Guild == null || withdrawer.GuildMember == null) return;
if (withdrawer.Guild != Guild) return;
if (Guild.Money < withdrawl) return;
var member = withdrawer.GuildMember;
if (!member.HasRight(GuildPrivileges.WITHDRAW_GOLD) ||
member.HasRight(GuildPrivileges.WITHDRAW_GOLD_LOCK))
{
return;
}
if (member.BankMoneyWithdrawlAllowance < withdrawl)
{
return;
}
Guild.Money -= withdrawl;
withdrawer.Money += withdrawl;
member.BankMoneyWithdrawlAllowance -= withdrawl;
BankLog.LogEvent(GuildBankLogEntryType.WithdrawMoney, withdrawer, withdrawl, null, 0, null);
GuildHandler.SendMemberRemainingDailyWithdrawlAllowance(withdrawer, member.BankMoneyWithdrawlAllowance);
GuildHandler.SendGuildBankTabNames(withdrawer, bank);
GuildHandler.SendGuildBankTabContents(withdrawer, bank, 0);
GuildHandler.SendGuildBankMoneyUpdate(withdrawer, bank);
}
示例4: Initialize
protected internal override void Initialize(GameObject go)
{
//var hidden = (go.Entry as GOTrapEntry).Hidden;
//if (hidden)
{
// hide go
}
}
示例5: Teleport
private static void Teleport(GameObject go, Character chr)
{
if (go.Handler.CanBeUsedBy(chr))
{
// We need to enqueue a message when moving/removing/adding Objects in this method
var portal = (Portal)go;
chr.AddMessage(() => chr.TeleportTo(portal.Target));
}
}
示例6: SendRequest
public static void SendRequest(GameObject duelFlag, Character challenger, Character rival)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_REQUESTED))
{
packet.Write(duelFlag.EntityId);
packet.Write(challenger.EntityId);
rival.Client.Send(packet);
challenger.Client.Send(packet);
}
}
示例7: DepositMoney
public void DepositMoney(Character depositer, GameObject bankObj, uint deposit)
{
if (!CheckBankObj(depositer, bankObj)) return;
if (deposit == 0) return;
if (depositer.Money < deposit) return;
Guild.Money += deposit;
depositer.Money -= deposit;
BankLog.LogEvent(GuildBankLogEntryType.DepositMoney, depositer, deposit, null, 0, null);
GuildHandler.SendGuildBankTabNames(depositer, bankObj);
GuildHandler.SendGuildBankTabContents(depositer, bankObj, 0);
GuildHandler.SendGuildBankMoneyUpdate(depositer, bankObj);
}
示例8: DepositMoney
public void DepositMoney(Character depositer, GameObject bank, uint deposit)
{
if (deposit == 0) return;
if (!bank.CanInteractWith(depositer)) return;
if (depositer.Guild == null || depositer.GuildMember == null) return;
if (depositer.Guild != Guild) return;
if (depositer.Money < deposit) return;
Guild.Money += deposit;
depositer.Money -= deposit;
BankLog.LogEvent(GuildBankLogEntryType.DepositMoney, depositer, deposit, null, 0, null);
GuildHandler.SendGuildBankTabNames(depositer, bank);
GuildHandler.SendGuildBankTabContents(depositer, bank, 0);
GuildHandler.SendGuildBankMoneyUpdate(depositer, bank);
}
示例9: Blastenheimer5000Used
private static bool Blastenheimer5000Used(GameObject go, Character user)
{
var cast = user.SpellCast;
var target = go.GetNearbyGO(CannonTarget, 1000);
if(target != null)
{
var dist = go.GetDistance(target);
}
switch (go.EntryId)
{
case (uint)Blastenheimer5000ElwynnId:
{
cast.Start(CannonPrepId);
user.StandState = StandState.Sit;
user.IncMechanicCount(SpellMechanic.Rooted);
var facing = target != null ? go.GetAngleTowards(target) : ElwynnTeleOrientation;
user.TeleportTo(ElwynnTelePosition, facing);
} break;
case (uint)Blastenheimer5000TerokkarId:
{
cast.Start(CannonPrepId);
user.StandState = StandState.Sit;
user.IncMechanicCount(SpellMechanic.Rooted);
var facing = target != null ? go.GetAngleTowards(target) : TerokkarTeleOrientation;
user.TeleportTo(TerokkarTelePosition, facing);
} break;
case (uint)Blastenheimer5000MulgoreId:
{
cast.Start(CannonPrepMulgore);
user.StandState = StandState.Sit;
user.IncMechanicCount(SpellMechanic.Rooted);
var facing = target != null ? go.GetAngleTowards(target) : MulgoreTeleOrientation;
user.TeleportTo(MulgoreTelePosition, facing);
} break;
default:
{
user.DecMechanicCount(SpellMechanic.Rooted);
return false;
}
}
go.PlaySound(8476);
user.CallDelayed(2000, obj => FireCannon(user));
return true;
}
示例10: Apply
public override void Apply()
{
var goId = (GOEntryId)Effect.MiscValue;
var goEntry = GOMgr.GetEntry(goId);
var caster = m_cast.CasterUnit;
if (goEntry != null)
{
if (Cast.TargetLoc.X != 0)
{
var worldLocation = new WorldLocation(caster.Map, Cast.TargetLoc);
go = goEntry.Spawn(worldLocation);
}
else
{
go = goEntry.Spawn(caster, null);
}
go.State = GameObjectState.Enabled;
go.Orientation = caster.Orientation;
go.ScaleX = 1;
}
}
示例11: InitGO
/// <summary>
/// Is called when the given new GameObject has been created.
/// </summary>
/// <param name="go"></param>
internal protected virtual void InitGO(GameObject go)
{
}
示例12: OnUse
private static bool OnUse(GameObject go, Character chr)
{
var portal = (Portal)go;
chr.TeleportTo(portal.Target);
return true;
}
示例13: TonkConsoleActivated
private static void TonkConsoleActivated(GameObject obj)
{
obj.State = GameObjectState.Enabled;
}
示例14: OnPlayerClickedOnflag
public virtual void OnPlayerClickedOnflag(GameObject go, Character chr)
{
}
示例15: SoulPrisonUsed
private static bool SoulPrisonUsed(GameObject go, Character user)
{
var nearest = go.GetNearbyNPC(NPCId.UnworthyInitiateAnchor, 2);
if (nearest == null) return false;
var shackled = nearest.ChannelObject as NPC;
if (shackled == null) return false;
var transformSpellId = GetTransformSpellIdFor(shackled.DisplayId);
//just clear all auras! uh oh...not
shackled.Auras.Clear();
shackled.IsInvulnerable = false;
go.Flags = GameObjectFlags.None;
shackled.StandState = StandState.Stand;
shackled.Emote(EmoteType.SimpleTalk);
shackled.Say("They brand me unworthy? I will show them unworthy!");
shackled.Spells.Clear();
shackled.Spells.AddSpell(
SpellId.ClassSkillPlagueStrikeRank1_2,
SpellId.ClassSkillIcyTouchRank1_2,
SpellId.ClassSkillBloodStrikeRank1_2,
SpellId.ClassSkillDeathCoil,
SpellId.ClassSkillDeathCoilRank1_3);
shackled.CallDelayed(3000, wObj => ((NPC)wObj).MoveInFrontThenExecute(go, npc =>
{
npc.Emote(EmoteType.SimpleLoot);
npc.CallDelayed(4000, obj =>
{
obj.SpellCast.TriggerSelf(SpellId.DeathKnightInitiateVisual);
obj.SpellCast.TriggerSelf(transformSpellId);
((NPC) obj).VirtualItem1 = ItemId.RunedSoulblade;
obj.FactionId = FactionId.ActorEvil;
});
npc.CallDelayed(7000, obj =>
{
((NPC)obj).Emote(EmoteType.SimplePointNosheathe);
obj.Say("To battle!");
});
npc.CallDelayed(9000, obj =>
{
((NPC)obj).ThreatCollection[user] += 10000;
((NPC)obj).UnitFlags &= ~UnitFlags.SelectableNotAttackable;
((NPC)obj).UnitFlags &= ~UnitFlags.NotAttackable;
((NPC) obj).Target = user;
((NPC)obj).Brain.State = BrainState.Combat;
});
}));
return true;
}