Request: Create new plugin MQ2Outdoors

PeteSampras

Your UI is fucking you. Stop using it.
Joined
Dec 12, 2007
Messages
3,956
Reaction score
49
Points
38
Is anyone able to create a plugin that will check to see if a zone is considered outdoors via either a list of zones with a outdoor.zone=TRUE/FALSE .ini associated with it or with it built in? I've looked as best I can and I don't see one. If there is one already, please ignore me/post what site it is available on. If i knew how to code myself, I'd just make it. This command could be used in almost every macro that uses a mount or selos which is why I suggest creating it as a plugin instead of a .inc.

Associated TLO you'd want: ${Me.Outdoors} or something similiar reporting back a TRUE/FALSE or 1/0.
 
Ah thanks, ya, im familiar with the ways to use it as a holyshit/downshit. But that brings up several problems as a caster. I already get the job done in the macros I make. Having a plugin would just make it that much more easily done without the extra coding. Since any macro that would use a mount or selos would need this check, i figured a plugin would be better.

How it is currently done inside my macs:

Code:
#event InDoors          "#*#You can only cast this spell in the outdoors#*#"
#event InDoors          "#*#This spell does not work here#*#"
#event InDoors  "#*#You are already on a mount#*#"
#event InDoors          "#*#You can not summon a mount here#*#"
Sub Main
/declare Outside bool outer TRUE
------------------------
 
Sub Buffs
 /if (${UseMount} && ${Outside} && !${Me.Mount.ID}) /call Cast "${MountName}" item
 
 /if (${UseSelos} && ${Outside} && !${Me.Buff[${Selos}]}) /call Cast "${SelosSpell}" ${SelosGem}
------------------------
 
Sub Event_InDoors
   /varset Outside FALSE
/return

The problem is once you set that variable to outside as FALSE, theres no way to set it to true again without zoning. Aka. you die and need to remount, or you FD and need to remount, or you accidently click it off. The only route is to then manually mount again. Also, sometimes it will spam mount a couple times even when mounted, despite the check.

I guess the ghetto solution would to be to add an event to remount. ala:

Code:
#event Outdoors "[MQ2] checkremount"*"
 
Sub Event_Outdoors
  /varset Outside TRUE
/return

and then throw in a check if you have no buffs or if you are FD, then to add a line onto the Buffs sub to /echo checkremount.
 
don't think this is possible its something that people have asked for over the years and it never gets done. If it is possible it is elusive to say the least

your best bet would be to zone to every zone and attempt to cast your mount. From that point store it in an INI file and call it like autobot does ingore lists
 
don't think this is possible its something that people have asked for over the years and it never gets done. If it is possible it is elusive to say the least

your best bet would be to zone to every zone and attempt to cast your mount. From that point store it in an INI file and call it like autobot does ingore lists


Alright, if that's the easiest answer, then it won't be very hard. Can just make a master list of all the zones. Then make it as a .inc. Have it change the variable each time it encounters the events other than already mounted. I can make that easily enough. Will get it out sometime this week when I have time hopefully. Even better yet. Don't even need to make a master zone list. Can just have it create zones as you go to them a la the ignore list. Thanks for the info JJ.
 
a plugin for this would be very easy, if i have some free time i'll make it
 
${Outdoors} or ${Outdoors.CurrentZone}

Returns false if zone isn't listed, list has some zones I wasnt sure about up top, uncomment them if you know they are outdoor and comment them out if they are actually indoor.

Code:
// MQ2Outdoors.cpp : Defines the entry point for the DLL application.
//

// PLUGIN_API is only to be used for callbacks.  All existing callbacks at this time
// are shown below. Remove the ones your plugin does not use.  Always use Initialize
// and Shutdown for setup and cleanup, do NOT do it in DllMain. 

// digitalpixel
// ${Outdoors} or ${Outdoors.CurrentZone}
// Returns true if zone matches zone name listed in array below.

#include "../MQ2Plugin.h"
PreSetup("MQ2Outdoors");

const char* OutdoorZones[] = {
    // Unsure
    "Abysmal Sea",
    //"Ak'Anon",
    "Crescent Reach",
    "East Cabilis",
    "East Freeport",
    "Erudin",
    //"Erudin Palace",
    //"Freeport Sewers",
    //"Grobb",
    "Guild Hall",
    "Guild Lobby",
    //"Halas",
    //"Kael Drakkel: A Daring Raid",
    //"Katta Castellum",
    "Katta Castrum",
    //"Neriak Commons",
    //"Neriak Foreign Quarter",
    //"Neriak Third Gate",
    //"North Kaladim",
    "North Qeynos",
    "North Qeynos: Sleeping on the Job",
    "Northern Felwithe",
    //"Oggok",
    //"Paineel",
    "The Plane of Knowledge",
    "Rivervale",
    //"Shadow Haven",
    //"Shadowrest",
    //"Shar Vahl",
    //"Skyshrine",
    //"Solusek's Eye: War Machines",
    //"South Kaladim",
    "South Qeynos",
    "Southern Felwithe",
    //"Surefall Glade",
    "The Bazaar",
    //"The Nexus",
    //"Thurgadin",
    //"West Cabilis",
    "West Freeport",
    // Pretty Sure
    "Arcstone, Isle of Spirits",
    "Asylum of Anguish",
    "Barindu, Hanging Gardens",
    "Barren Coast",
    "Blackburrow",
    "Blackburrow: Reinforced Blackburrow",
    "Blackfeather Roost",
    "Blacksail Folly: A Spy Among Them",
    "Blacksail Folly: Buried Treasure",
    "Blacksail Folly: Reduce His Numbers",
    "Blacksail Folly: Running Rum",
    "Blacksail Folly: Sharpeye's Demise",
    "Blightfire Moors",
    "Bloody Kithicor",
    "Bloody Kithicor: Raid Instance",
    "Bloody Kithicor: Safe Passage",
    "Burning Woods",
    "Butcherblock Mountains",
    "Castle Mistmoore",
    "Cazic-Thule",
    "Cazic-Thule: Lost Temple of Cazic-Thule",
    "City of Dranik",
    "City of Mist",
    "Cobalt Scar",
    "Commonlands",
    "Corathus Creep",
    "Crushbone",
    "Crushbone: Dethroning the Emperor",
    "Dagnor's Cauldron",
    "Dawnshroud Peaks",
    "Deadbone Reef: Pirate Stew",
    "Deadbone Reef: Shipping Lanes",
    "Deadbone Reef: The Drowned Dead",
    "Direwind Cliffs",
    "Dominion of Despair",
    "Doomfire, the Burning Lands",
    "Dragonscale Hills",
    "Dranik's Scar",
    "Dreadlands",
    "Dulak's Harbor",
    "Dulak's Harbor: The Grozmok Stone",
    "East Commonlands: A Griffin's Plight",
    "East Freeport: The Poisoned Flounder",
    "East Karana",
    "Eastern Wastes",
    "Eastern Wastes: Cage Kerafyrm",
    "Emerald Jungle",
    "Erud's Crossing",
    "Eryslai, the Kingdom of Wind",
    "Estate of Unrest",
    "Estate of Unrest: Greater Unrest",
    "Estate of Unrest: The Curse Begins",
    "Everfrost Peaks",
    "Everfrost Peaks: Battle for Permafrost",
    "Field of Bone",
    "Field of Scale",
    "Field of Scale: Raid Instance",
    "Firiona Vie",
    "Fortress Mechanotus",
    "Freeport Arena",
    "Frontier Mountains",
    "Frontier Mountains: One Shall Rule Them All",
    "Gorge of King Xorbb",
    "Goru`kar Mesa",
    "Great Divide",
    "Great Divide: The Defense of Thurgadin",
    "Great Divide: The Founding of Thurgadin",
    "Greater Faydark",
    "Grieg's End",
    "Grimling Forest",
    "Grobb: Grobb Under Siege",
    "Gulf of Gunthak",
    "Gyrospire Beza",
    "Gyrospire Beza: End the Return",
    "Gyrospire Beza: How Does Your Garden Grow",
    "Gyrospire Beza: It's All in Your Head",
    "Gyrospire Beza: Sand in the Gears",
    "Gyrospire Beza: Scout Gyrospire Beza",
    "Gyrospire Zeka",
    "Gyrospire Zeka: Cut Off the Head",
    "Gyrospire Zeka: Did We Forget the Cheese",
    "Gyrospire Zeka: Intelligence Gathering",
    "Gyrospire Zeka: To Climb a Spire",
    "Gyrospire Zeka: You Might Poke an Eye Out",
    "Halls of Honor",
    "Hate's Fury, The Scorned Maiden",
    "Hate's Fury: Setting Sail",
    "High Keep",
    "High Keep: Pickclaw's Revenge",
    "High Keep: Storming the Keep",
    "Highpass Hold",
    "Hills of Shade",
    "Hollowshade Moor",
    "Iceclad Ocean",
    "Icefall Glacier",
    "Innothule Swamp",
    "Jardel's Hook: Jardel's Hidden Cove",
    "Kaesora",
    "Kaesora: Zebuxoruk's Pact",
    "Karnor's Castle",
    "Kithicor Forest",
    "Kod'Taz, Broken Trial Grounds",
    "Korafax, Home of the Riders",
    "Korafax: Inside Information",
    "Korafax: Kill the Shearspawn",
    "Korafax: Meeting Adjourned",
    "Korafax: Stardouser",
    "Korascian Warrens",
    "Lair of Terris Thule",
    "Lake of Ill Omen",
    "Lake Rathetear",
    "Lavastorm Mountains",
    "Lesser Faydark",
    "Lesser Faydark: Brownies of Doom",
    "Loping Plains",
    "Maiden's Grave: If You Can't Beat Em",
    "Maiden's Grave: Mer's Lost Love",
    "Maiden's Grave: Never Trust a Siren",
    "Maiden's Grave: Piecing Things Together",
    "Maiden's Grave: The Grim News",
    "Marus Seru",
    "Misty Thicket",
    "Monkey Rock: A Volatile Disease",
    "Monkey Rock: An Experiment Gone Wrong",
    "Monkey Rock: Cleansing the Island",
    "Monkey Rock: Long Abandoned",
    "Mons Letalis",
    "Mountains of Rathe",
    "Muramite Proving Grounds",
    "Natimbi, The Broken Shores",
    "Nedaria's Landing",
    "Nektulos Forest",
    "Nektulos Forest: Wanted Dead or Alive",
    "Nobles' Causeway",
    "North Karana",
    "North Ro",
    "Ocean of Tears",
    "Oceangreen Hills",
    "Oceangreen Village",
    "Oceangreen Village: A Dread Challenger",
    "Oceangreen Village: Stop the Contamination",
    "Old Blackburrow",
    "Old Blackburrow: Beat the Blackburrow Boss",
    "Old Blackburrow: Freedom!",
    "Old Blackburrow: Stop the Ascension",
    "Old Blackburrow: Disrupting the Ritual",
    "Old Bloodfields",
    "Old Bloodfields: Holding the Fort",
    "Old Commonlands",
    "Old Commonlands: Bitter Victuals",
    "Old Commonlands: Safe Passage",
    "The Plane of Disease",
    "The Plane of Fear",
    "The Plane of Growth",
    "The Plane of Hate",
    "The Plane of Hate: Innoruuk's Realm",
    "The Plane of Innovation ",
    "The Plane of Justice",
    "The Plane of Mischief",
    "The Plane of Nightmare",
    "The Plane of Sky",
    "The Plane of Storms",
    "The Plane of Time",
    "The Plane of Tranquility",
    "The Plane of Valor",
    "Proving Grounds: The Mastery of Specialization",
    "Qeynos Hills",
    "Qinimi, Court of Nihilia",
    "Qvic, Prayer Grounds of Calling",
    "Ragrax, Stronghold of the Twelve",
    "Redfeather Isle: Mystery of Aviak Island",
    "Redfeather Isle: The Final Lyric",
    "Relic, the Artifact City",
    "Rivervale: Zombie Invasion",
    "Riwwi, Coliseum of Games",
    "Ruins of Takish-Hiz",
    "S.H.I.P. Workshop: Administrative Assassination",
    "S.H.I.P. Workshop: Deception and Interception",
    "S.H.I.P. Workshop: Mechalossus",
    "S.H.I.P. Workshop: S.H.I.P Sabotage!",
    "S.H.I.P. Workshop: Tactical Teleportation",
    "Sanctus Seru",
    "Shadeweaver's Thicket",
    "Shadowed Grove: Queen Nok Nok's Tomb",
    "Shadowed Grove: The Rescue of Vodrak",
    "Skyfire Mountains",
    "Solteris, the Throne of Ro",
    "South Karana",
    "South Karana: The Gnolls Know",
    "South Ro",
    "Steamfont Mountains",
    "Stillmoon Temple: Guardian of the Sands",
    "Stillmoon Temple: Scales of Justice",
    "Stone Hive",
    "Stonebrunt Mountains",
    "Stonebrunt Mountains: The Kejek Trials",
    "Stoneroot Falls",
    "Stoneroot Falls: A Rogue's Trust",
    "Stoneroot Falls: Building the Disguise",
    "Stoneroot Falls: Scouting the City",
    "Suncrest Isle: Altar Call",
    "Suncrest Isle: Pay a Visit",
    "Suncrest Isle: Repaying the Tidewater Goblins",
    "Suncrest Isle: Sunstone Savages",
    "Suncrest Isle: The Secret of Suncrest Ridge",
    "Sunderock Springs",
    "Sunset Home",
    "Sverag, Stronghold of Rage",
    "Swamp of No Hope",
    "Temple of Marr",
    "The Arena",
    "The Ascent",
    "The Ascent: Death Comes Swiftly",
    "The Ascent: Kessdona's Perch",
    "The Ascent: Reflections of Silver",
    "The Ascent: Signal Fires",
    "The Ascent: Sudden Tremors",
    "The Ascent: Drake Eggs",
    "The Ascent: Storm Dragon Scales",
    "The Bloodfields",
    "The Broodlands",
    "The Buried Sea",
    "The Devastation",
    "The Elddar Forest",
    "The Feerrott",
    "The Grey",
    "The Hive",
    "The Hive: Freeing an Elder",
    "The Hive: Infiltrating the Hive",
    "The Hive: The Accursed Book",
    "The Hive: The Orb of Subversion",
    "The Jaggedpine Forest",
    "The Maiden's Eye",
    "The Open Sea: Hired Hands",
    "The Overthere",
    "The Overthere: The Fall of the Shissar",
    "The Precipice of War",
    "The Ruined City of Dranik",
    "The Scarlet Desert",
    "The Steppes",
    "The Tenebrous Mountains",
    "The Twilight Sea",
    "The Umbral Plains",
    "The Void",
    "The Wakening Land",
    "The Warrens",
    "Theater of Blood",
    "Theater of the Tranquil",
    "Thundercrest Isles",
    "Thundercrest Isles: A Simple Task",
    "Thundercrest Isles: An End to the Storms",
    "Thundercrest Isles: Behind Closed Doors",
    "Thundercrest Isles: History of the Isle",
    "Thundercrest Isles: Holy Hour",
    "Thundercrest Isles: Lair Unguarded",
    "Thundercrest Isles: Scions of Thundercrest",
    "Thundercrest Isles: Splitting the Storm",
    "Thundercrest Isles: The Creator",
    "Thundercrest Isles: The Gilded Scroll",
    "Thundercrest Isles: Throes of Contagion",
    "Timorous Deep",
    "Tipt, Treacherous Crags",
    "Torden, the Bastion of Thunder",
    "Toxxulia Forest",
    "Trakanon's Teeth",
    "Undershore",
    "Undershore: Trailing Longshadow",
    "Valdeholm",
    "Valdeholm: Kill Kangur",
    "Valdeholm: Speak with the King",
    "Valdeholm: Udengar the Traitor",
    "Vegarlson, the Earthen Badlands",
    "Vxed, The Crumbling Caverns",
    "Wall of Slaughter",
    "Warsliks Wood",
    "West Karana",
    "Western Wastes",
    "Yxtta, Pulpit of Exiles"
};

int bOutdoors;

bool AreWeOutdoors()
{
    PZONEINFO ZoneInfo = (PZONEINFO)pZoneInfo;
    const char* current_zone = ZoneInfo->LongName;
    const int zone_array = sizeof OutdoorZones / sizeof *OutdoorZones;

    for(int i=0; i != zone_array; i++)
        if(!stricmp(current_zone, OutdoorZones[i]))
            return true;
    return false;
}

class MQ2OutdoorsType *pOutdoorsType=0;

class MQ2OutdoorsType : public MQ2Type
{
public:
    enum OutdoorsMembers
    {
        CurrentZone=1,
    };

    MQ2OutdoorsType():MQ2Type("Outdoors")
    {
        TypeMember(CurrentZone);
    }
    ~MQ2OutdoorsType()
    {
    }

    bool GetMember(MQ2VARPTR VarPtr, PCHAR Member, PCHAR Index, MQ2TYPEVAR &Dest)
    {
        PMQ2TYPEMEMBER pMember=MQ2OutdoorsType::FindMember(Member);
        if (!pMember)
            return false;
        switch((OutdoorsMembers)pMember->ID)
        {
        case CurrentZone:
            Dest.Int=bOutdoors;
            Dest.Type=pBoolType;
            return true;
        }
        return false;
    }

    bool ToString(MQ2VARPTR VarPtr, PCHAR Destination)
    {
        if (bOutdoors)
            strcpy(Destination,"TRUE");
        else
            strcpy(Destination,"FALSE");
        return true;
    }

    bool FromData(MQ2VARPTR &VarPtr, MQ2TYPEVAR &Source)
    {
        return false;
    }
    bool FromString(MQ2VARPTR &VarPtr, PCHAR Source)
    {
        return false;
    }
};

BOOL dataOutdoors(PCHAR szName, MQ2TYPEVAR &Dest)
{
    Dest.DWord=1;
    Dest.Type=pOutdoorsType;
    return true;
}

// Called once, when the plugin is to initialize
PLUGIN_API VOID InitializePlugin(VOID)
{
    DebugSpewAlways("Initializing MQ2Outdoors");
    AddMQ2Data("Outdoors",dataOutdoors);
    if(AreWeOutdoors() == true) {
        bOutdoors = true;
    } else {
        bOutdoors = false;
    }

    pOutdoorsType = new MQ2OutdoorsType;
}

// Called once, when the plugin is to shutdown
PLUGIN_API VOID ShutdownPlugin(VOID)
{
    DebugSpewAlways("Shutting down MQ2Outdoors");
    RemoveMQ2Data("Outdoors");

    delete pOutdoorsType;
}

// Called after entering a new zone
PLUGIN_API VOID OnZoned(VOID)
{
    DebugSpewAlways("MQ2Outdoors::OnZoned()");
    if(AreWeOutdoors() == true) {
        bOutdoors = true;
    } else {
        bOutdoors = false;
    }
}