More updates to scripts (still wont build)

This commit is contained in:
hondacrx
2023-10-13 16:11:34 -04:00
parent cda53c8e7f
commit 33091ed942
26 changed files with 4195 additions and 2894 deletions
+36 -70
View File
@@ -1,44 +1,38 @@
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
using Framework.Constants;
using Game.AI;
using Game.Entities;
using Game.Scripting;
using Game.AI;
using Framework.Constants;
using static Global;
namespace Scripts.World.NpcInnkeeper
{
struct SpellIds
{
public const uint TrickOrTreated = 24755;
public const uint Treat = 24715;
}
struct Gossip
{
public const uint MenuId = 9733;
public const uint MenuEventId = 342;
}
[Script]
class npc_innkeeper : ScriptedAI
{
const uint SpellTrickOrTreated = 24755;
const uint SpellTreat = 24715;
const uint NpcGossipMenu = 9733;
const uint NpcGossipMenuEvent = 342;
public npc_innkeeper(Creature creature) : base(creature) { }
public override bool OnGossipHello(Player player)
{
player.InitGossipMenu(Gossip.MenuId);
if (Global.GameEventMgr.IsHolidayActive(HolidayIds.HallowsEnd) && !player.HasAura(SpellIds.TrickOrTreated))
player.AddGossipItem(Gossip.MenuEventId, 0, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
player.InitGossipMenu(NpcGossipMenu);
if (GameEventMgr.IsHolidayActive(HolidayIds.HallowsEnd) && !player.HasAura(SpellTrickOrTreated))
player.AddGossipItem(NpcGossipMenuEvent, 0, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
if (me.IsQuestGiver())
player.PrepareQuestMenu(me.GetGUID());
if (me.IsVendor())
player.AddGossipItem(Gossip.MenuId, 2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionTrade);
if (me.IsVendor())
player.AddGossipItem(NpcGossipMenu, 2, eTradeskill.GossipSenderMain, eTradeskill.GossipActionTrade);
if (me.IsInnkeeper())
player.AddGossipItem(Gossip.MenuId, 1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInn);
player.AddGossipItem(NpcGossipMenu, 1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInn);
player.TalkedToCreature(me.GetEntry(), me.GetGUID());
player.SendGossipMenu(player.GetGossipTextId(me), me.GetGUID());
@@ -49,67 +43,39 @@ namespace Scripts.World.NpcInnkeeper
{
uint action = player.PlayerTalkClass.GetGossipOptionAction(gossipListId);
player.ClearGossipMenu();
if (action == eTradeskill.GossipActionInfoDef + 1 && Global.GameEventMgr.IsHolidayActive(HolidayIds.HallowsEnd) && !player.HasAura(SpellIds.TrickOrTreated))
if (action == eTradeskill.GossipActionInfoDef + 1 && GameEventMgr.IsHolidayActive(HolidayIds.HallowsEnd) && !player.HasAura(SpellTrickOrTreated))
{
player.CastSpell(player, SpellIds.TrickOrTreated, true);
player.CastSpell(player, SpellTrickOrTreated, true);
if (RandomHelper.IRand(0, 1) != 0)
player.CastSpell(player, SpellIds.Treat, true);
if (RandomHelper.URand(0, 1) != 0)
player.CastSpell(player, SpellTreat, true);
else
{
uint trickspell = 0;
switch (RandomHelper.IRand(0, 13))
switch (RandomHelper.URand(0, 13))
{
case 0:
trickspell = 24753;
break; // cannot cast, random 30sec
case 1:
trickspell = 24713;
break; // lepper gnome costume
case 2:
trickspell = 24735;
break; // male ghost costume
case 3:
trickspell = 24736;
break; // female ghostcostume
case 4:
trickspell = 24710;
break; // male ninja costume
case 5:
trickspell = 24711;
break; // female ninja costume
case 6:
trickspell = 24708;
break; // male pirate costume
case 7:
trickspell = 24709;
break; // female pirate costume
case 8:
trickspell = 24723;
break; // skeleton costume
case 9:
trickspell = 24753;
break; // Trick
case 10:
trickspell = 24924;
break; // Hallow's End Candy
case 11:
trickspell = 24925;
break; // Hallow's End Candy
case 12:
trickspell = 24926;
break; // Hallow's End Candy
case 13:
trickspell = 24927;
break; // Hallow's End Candy
case 0: trickspell = 24753; break; // cannot cast, random TimeSpan.FromSeconds(30)ec
case 1: trickspell = 24713; break; // lepper gnome Costume
case 2: trickspell = 24735; break; // male ghost Costume
case 3: trickspell = 24736; break; // female ghostCostume
case 4: trickspell = 24710; break; // male ninja Costume
case 5: trickspell = 24711; break; // female ninja Costume
case 6: trickspell = 24708; break; // male pirate Costume
case 7: trickspell = 24709; break; // female pirate Costume
case 8: trickspell = 24723; break; // skeleton Costume
case 9: trickspell = 24753; break; // Trick
case 10: trickspell = 24924; break; // Hallow's End Candy
case 11: trickspell = 24925; break; // Hallow's End Candy
case 12: trickspell = 24926; break; // Hallow's End Candy
case 13: trickspell = 24927; break; // Hallow's End Candy
}
player.CastSpell(player, trickspell, true);
}
player.CloseGossipMenu();
player.ClearGossipMenu();
return true;
}
player.CloseGossipMenu();
player.ClearGossipMenu();
switch (action)
{