public void AddTok(UInt32 Entry) { if (HasTok(Entry)) { return; } Tok_Info Info = WorldMgr.GetTok(Entry); if (Info == null) { return; } SendTok(Entry, true); Character_tok Tok = new Character_tok(); Tok.TokEntry = Entry; Tok.CharacterId = GetPlayer().CharacterId; Tok.Count = 1; Tok.Dirty = true; _Toks.Add(Entry, Tok); GetPlayer().AddXp(Info.Xp); GetPlayer()._Info.Toks = _Toks.Values.ToArray(); CharMgr.Database.AddObject(Tok); }
public override void SendInteract(Player Plr, InteractMenu Menu) { Tok_Info Info = WorldMgr.GetTok((UInt32)Spawn.Proto.TokUnlock); if (!IsDead) { Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_USE_GO, Spawn.Entry, 1); } Plr.TokInterface.AddTok(Info.Entry); base.SendInteract(Plr, Menu); }
static public bool AddTok(Player Plr, ref List <string> Values) { int TokEntry = GetInt(ref Values); Tok_Info Info = WorldMgr.GetTok((UInt32)TokEntry); if (Info == null) { return(false); } Plr = GetTargetOrMe(Plr); Plr.TokInterface.AddTok(Info.Entry); return(false); }
static public bool ChapterTok(Player Plr, ref List <string> Values) { int Entry = GetInt(ref Values); int TokEntry = GetInt(ref Values); Chapter_Info Chapter = WorldMgr.GetChapter((UInt32)Entry); Tok_Info Tok = WorldMgr.GetTok((UInt32)Entry); if (Tok == null || Chapter == null) { return(false); } Chapter.TokEntry = (UInt32)TokEntry; Chapter.Dirty = true; WorldMgr.Database.SaveObject(Chapter); return(true); }
public override void SendInteract(Player Plr, InteractMenu Menu) { Tok_Info Info = WorldMgr.GetTok(Spawn.Proto.TokUnlock); if (!IsDead) { Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_USE_GO, Spawn.Entry, 1); } if (Spawn.Proto.TokUnlock != 0) { Plr.TokInterface.AddTok(Info); } Loot Loots = LootsMgr.GenerateLoot(this, Plr); if (Loots != null) { Loots.SendInteract(Plr, Menu); // If object has been looted, make it unlootable // and then Reset its lootable staus in XX seconds if (!Loots.IsLootable()) { Looted = true; foreach (Object Obj in this._ObjectRanged) { if (Obj.IsPlayer()) { this.SendMeTo(Obj.GetPlayer()); } } EvtInterface.AddEvent(ResetLoot, RELOOTABLE_TIME, 1); } } base.SendInteract(Plr, Menu); }
public override void SendInteract(Player Plr, InteractMenu Menu) { Log.Success("SendInteract", "" + Name + " -> " + Plr.Name + ",Type=" + InteractType); PacketOut Out = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER); Out.WriteByte(0); // 00 Out.WriteByte(1); // 01 Out.WriteByte(1); // 01 Out.WriteByte(5); // 05 Out.WriteUInt16(0); //00 00 Out.WriteUInt16(Spawn.GameObjTimer); // 13 88 =5000 Out.WriteUInt16(Oid); Out.WriteUInt16(0); Plr.SendPacket(Out); if (Spawn.GameObjTimer == 0) { Out = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER); Out.WriteByte(0); // 00 Out.WriteByte(1); // 01 Out.WriteByte(1); // 01 Out.WriteUInt16(0); //00 00 Out.WriteUInt16(0); // 13 88 Out.WriteUInt16(0); Out.WriteUInt16(0); Out.WriteByte(0); Plr.SendPacket(Out); } Out = new PacketOut((byte)Opcodes.F_PLAY_EFFECT); Out.WriteUInt16((UInt16)0x0144); Out.WriteByte(0);// 00 Out.WriteUInt16((UInt16)Spawn.WorldZ); Out.WriteUInt32((UInt32)Spawn.WorldX); Out.WriteUInt32((UInt32)Spawn.WorldY); Out.WriteUInt16(0x0017);// 00 17 Out.Fill(0, 5); Plr.SendPacket(Out); Tok_Info Info = WorldMgr.GetTok(Spawn.Proto.TokUnlock); if (!IsDead) { Plr.QtsInterface.HandleEvent(Objective_Type.QUEST_USE_GO, Spawn.Entry, 1); } if (Spawn.Proto.TokUnlock != 0) { Plr.TokInterface.AddTok(Info); } Loot Loots = LootsMgr.GenerateLoot(this, Plr); if (Loots != null) { Loots.SendInteract(Plr, Menu); // If object has been looted, make it unlootable // and then Reset its lootable staus in XX seconds if (!Loots.IsLootable()) { Looted = true; foreach (Object Obj in this._ObjectRanged) { if (Obj.IsPlayer()) { this.SendMeTo(Obj.GetPlayer()); } } EvtInterface.AddEvent(ResetLoot, RELOOTABLE_TIME, 1); } } if (Spawn.DoorId != 0) { if (DoorOpen) { CloseDoor(); } else { OpenDoor(); } } base.SendInteract(Plr, Menu); }