Jaden
not so active
- Thread starter
- #21
Snippets as Requested: Gang/Turf Claim
Code:
public void StartClaim(GameClient Session, Room Room, int TurfID)
{
if (Habbo.TurfExists(TurfID) == true)
{
if(Habbo.IsInGang(Session.GetHabbo()) == true)
{
if (Habbo.OwnsTurf(TurfID, Session.GetHabbo().gangId) == false)
{
RoomUser roomuser = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (Habbo.getTurfOwner(TurfID) != 0)
{
Habbo.SendToGang(Habbo.getTurfOwner(TurfID),Habbo.GetGangName(Session.GetHabbo().gangId) + " is claiming your turf in roomid " + Session.GetHabbo().CurrentRoomId + ", go stop them!");
}
Session.GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(59);
Room.SendMessage(new Mango.Communication.Packets.Outgoing.Rooms.Chat.ShoutComposer(roomuser.VirtualId, "*Begins claiming the turf in the name of " + Habbo.GetGangName(Session.GetHabbo().gangId) + "*", 0, 1));
Session.GetHabbo().RPTimer = 8;
Session.GetHabbo().StartTimer("gangclaim", Session);
ThreadStart start = () => HandleGangClaim(Session, Room, roomuser);
GangClaimLooperz = new Thread(start);
GangClaimLooperz.Priority = ThreadPriority.Lowest;
GangClaimLooperz.Start();
}
else
Session.SendWhisper("Your gang already owns this turf.");
}
else
Session.SendWhisper("You are not in a gang!");
}
else
{
Session.SendWhisper("Nothing to claim here.");
}
}