Never thought of going for player serials for that kind of stuff, smart but could it be potentially dangerous?
 
Never thought of going for player serials for that kind of stuff, smart but could it be potentially dangerous?
I only recently swapped to using serial over the mobile, I noticed a trend in the default code when catching and using players, serials were used in most cases, it is unique so a perfect key to use in conditionals! I see nothing dangerous using them, like the player transfer, is nothing more than moving the serial as well! I actually have to give Pyro credit for opening my eyes, I read a response on discord that lead to the discovery of using the serial for this, unless I missed something, it seems like the best choice!
 
Ok I just recently run into a problem with this.
A melee player can use this system just fine and get the power scrolls when they kill the allotted monster/s.
Although just recently had a tamer character try to get a power scroll through this system and it would not award the power scroll on the monster death. Using a few different techniques to kill said monster to include casting spells on it while a summoned creature killed it to actually hitting it with a weapon. The tamer character does not have any pets that would be able to kill said monster/s if that would make a difference.
 
Ok I just recently run into a problem with this.
A melee player can use this system just fine and get the power scrolls when they kill the allotted monster/s.
Although just recently had a tamer character try to get a power scroll through this system and it would not award the power scroll on the monster death. Using a few different techniques to kill said monster to include casting spells on it while a summoned creature killed it to actually hitting it with a weapon. The tamer character does not have any pets that would be able to kill said monster/s if that would make a difference.
I'll add support for pets, good catch, check back in a day or so for an update!
 
I checked the code fix and it was just for controlled pets, and not for summoned creatures. So I updated the code to check for summoned creatures also as such.
C#:
if (e.Killer is BaseCreature bc && bc.Controlled && bc.ControlMaster is PlayerMobile cm)
                        {
                            pm = cm;
                        }
                        else if (e.Killer is BaseCreature dc && dc.Summoned && dc.SummonMaster is PlayerMobile sm)
                        {
                            pm = sm;
                        }
                        else
                        {
                            return;
                        }
 
I love the idea but, as we can see, the Master is listening but totally unresponsive to lines that follow the form of "give task _____"
1754972935142.png
 
Skill Mastery
Players must be maxed out in the skill for which they want to receive a task.

The master will only give a player a task for skills that are at GM, if the player doesn't have any GMed Skills, they are ignored!
 
Can't seem to get the Master to recognize when the task is finished. As before, he is listening and responding to his command lines. I changed all the table entries to zombie for this particular test because it wasn't working for the player's shadow wyrm either. Nevermind the spellcasting, etc. player hitting his hotkeys while typing.

1755048078938.png
The only other tweaks I have made so far is for his speech. File included just in case. Could you point out where the quest is updated?
 

Attachments

  • LegendaryMaster.cs
    12.1 KB · Views: 0
The master only gives and cancels tasks! Once you have a task, you go out and complete it within time and it'll reward you, it is tracking your kills!
 
The master only gives and cancels tasks! Once you have a task, you go out and complete it within time and it'll reward you, it is tracking your kills!
But it's not tracking the kills, is what I'm saying! See in that chat log where the character kills the zombie? It's the same for the skeletal dragon. That was the only way I could think of controlling the experiment.
 
How are you killing the zombies? using the staff commands side steps the system! If as a player your killing the task designated target, then after you kill them, it should reward you with a powerscroll for that skill!
 
Player char on player account. Using peacemaking and a bow. We've been testing it pretty strenuously in green acres. I summon whatever the monster is but killing it is NOT triggering the quest. Killing a spawner spawned creature also does not trigger the quest. Returning to the Master and asking for another task returns the comment about already having one which confirms the trigger isn't applying.
EvenSink_CreatureDeath had to be modified. Grok helped me with this:
C#:
        private static void EventSink_CreatureDeath(CreatureDeathEventArgs e)
        {
            if (e.Killer == null || e.Creature == null || !ValidateName(e.Creature.GetType()))
            {
                return;
            }

            PlayerMobile pm = null;

            if (e.Killer is BaseCreature bc)
            {
                if (bc.Controlled && bc.ControlMaster is PlayerMobile cm)
                {
                    pm = cm;
                }
                else if (bc.Summoned && bc.SummonMaster is PlayerMobile sm)
                {
                    pm = sm;
                }
            }
            else if (e.Killer is PlayerMobile killerPm)
            {
                pm = killerPm;
            }

            if (pm == null || taskInfos == null || taskInfos.Count == 0)
            {
                return;
            }

            // Find the active task for this player that matches the killed creature
            SkillTaskInfo currentInfo = taskInfos.FirstOrDefault(i =>
                i.PlayerSerial == pm.Serial &&
                !i.Completed &&
                i.TargetName == e.Creature.GetType());

            if (currentInfo != null)
            {
                if (currentInfo.TimeLimit <= DateTime.Now)
                {
                    pm.SendMessage(53, "You ran out of time for this task!");
                    currentInfo.Completed = true;
                }
                else
                {
                    // Valid kill: decrement and extend time
                    currentInfo.TaskAmount--;
                    currentInfo.TimeLimit += ExtraTaskTime;

                    if (currentInfo.TaskAmount <= 0)
                    {
                        // Award on final kill
                        pm.AddToBackpack(new PowerScroll(currentInfo.PlayerSkill, currentInfo.SkillCap + 5));
                        pm.SendMessage(53, $"You are awarded a {currentInfo.SkillCap + 5} {currentInfo.PlayerSkill} Powerscroll!");
                        TryGiveStatScroll(pm);
                        currentInfo.Completed = true;
                    }
                    else
                    {
                        // Continue task
                        currentInfo.TargetName = GetRandomCreature();
                        KillMessage(pm, currentInfo);
                    }
                }

                CleanTaskInfos();
            }
        }
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$500.00
Back