Esempio n. 1
0
 private new void OnDisplayCas()
 {
     try
     {
         if (!Target.Repairable.Broken && (Target.Upgradable.Inkinization || !RandomUtil.RandomChance01(Tattooing.GetChanceOfFailure(Actor, Actor))))
         {
             if (Target.TryDeductFunds(Actor, Actor))
             {
                 bool tookSemaphore = mTookSemaphore;
                 GiveTattooEx.DisplayCAS(Actor, ref tookSemaphore);
                 mTookSemaphore = tookSemaphore;
                 EventTracker.SendEvent(EventTypeId.kGotTattoo, Actor);
             }
         }
         else
         {
             TattooChair.AddFailureTattoo(Actor);
             EventTracker.SendEvent(EventTypeId.kGotTattoo, Actor);
             Actor.ShowTNSIfSelectable(TattooChair.LocalizeString("FailureTnsSelf", new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessageNegative, Target.ObjectId, Actor.ObjectId);
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(Actor, Target, e);
     }
 }
Esempio n. 2
0
        private new void OnDisplayCas()
        {
            try
            {
                Sim instanceActor = LinkedInteractionInstance.InstanceActor;
                if (instanceActor == null)
                {
                    return;
                }

                bool flag = !Target.Repairable.Broken && (Target.Upgradable.Inkinization || !RandomUtil.RandomChance01(Tattooing.GetChanceOfFailure(Actor, instanceActor)));
                if (!flag)
                {
                    Sim        actor  = instanceActor;
                    ObjectGuid choice = ObjectGuid.InvalidObjectGuid;
                    if (Actor.IsSelectable)
                    {
                        actor  = Actor;
                        choice = instanceActor.ObjectId;
                    }

                    if (instanceActor.IsSelectable || Actor.IsSelectable)
                    {
                        TattooChair.AddFailureTattoo(instanceActor);
                    }

                    actor.ShowTNSIfSelectable(TattooChair.LocalizeString("FailureTns" + RandomUtil.GetInt(0x2), new object[0x0]), StyledNotification.NotificationStyle.kSimTalking, Actor.ObjectId, choice);
                }
                else if ((Actor.IsSelectable || instanceActor.IsSelectable) && TryDeductFunds(Target, Actor, instanceActor))
                {
                    bool tookSemaphore = mTookSemaphore;
                    DisplayCAS(instanceActor, ref tookSemaphore);
                    mTookSemaphore = tookSemaphore;
                    EventTracker.SendEvent(EventTypeId.kGotTattoo, instanceActor);
                }

                ActiveTopic.AddToSim(instanceActor, "Got a Tattoo");

                (LinkedInteractionInstance as TattooChair.GetTattoo).IsSuccess = flag;
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
        }