Auto Announce Npc That Works With Mangos and Ascent menu

User Tag List

Results 1 to 10 of 10
  1. #1
    Cripto's Avatar Master Sergeant
    Reputation
    33
    Join Date
    Jul 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Auto Announce Npc That Works With Mangos and Ascent

    This is an auto announcer

    Works on both Ascent and Mangos

    Announcer.cpp


    Code:
    //***This script was released under CodeCraft and cannot be redistrubted without giving credits**
    //Title of Script: Anouncer v2
    //Description of Script: Sends a worldwide announcement in timed intervals.
    //Author: Daikenkaiking
    //Credits: Supalosa for his xml script that I learned some functions from.

    #include "StdAfx.h"
    #include "Setup.h"

    //Configure these as you wish
    #define BREAKTIME 300000 //The amount of seconds * 1000 you want to wait in between messages
    #define HEADERSTR "[Announcer]" //The string to place in front of the message

    //Define and create variables
    uint32 ann_next_id = 0;

    class Announcement
    {
    public:
    void Run();
    };

    void Announcement::Run()
    {
    // Variable Defines
    char query[255];
    char display_str[255];
    string body;
    uint32 id, next_id;

    if(ann_next_id == 0)
    {
    sprintf(query, "SELECT * FROM announcer_txt ORDER BY RAND() LIMIT 1");
    } else {
    sprintf(query, "SELECT * FROM announcer_txt WHERE id = %i", ann_next_id);
    }
    QueryResult * result = WorldDatabase.Query(query);

    //Uh oh!
    if(!result)
    {
    ShowMsg("Something went wrong or there is no data to display!");
    ann_next_id = 0;
    return;
    }

    //Lets get the data, and set everyting up
    Field * fields = result->Fetch();
    id = fields[0].GetUInt32();
    body = fields[1].GetString();
    next_id = fields[2].GetUInt32();

    //We may need to set next id, and set last id
    if(next_id != 0)
    ann_next_id = next_id;
    else
    ann_next_id = 0;

    //Lets format the String to display and then display it!
    sprintf(display_str, "%s %s", HEADERSTR, body.c_str());
    sWorld.SendWorldText(display_str);

    //to prevent overscope and leaking
    WorldDatabase.FreeQueryResult(result);
    }

    void ShowMsg(char * errmsg)
    {
    char errstr[255];
    sprintf(errstr, "\nAnnouncer v2: %s", errmsg);
    sLog.outString(errstr);
    }

    void SetupAnnouncer(ScriptMgr * mgr)
    {
    Announcement Announcer;
    //If all is good, set up the timer event and lets roll!
    if(BREAKTIME >= 1000)
    {
    TimedEvent * te = TimedEvent::Allocate(&Announcer, new CallbackP0<Announcement>(&Announcer, &Announcement::Run), 1, BREAKTIME, 0);
    sWorld.event_AddEvent(te);
    ShowMsg("Announcer has been started!");
    } else {
    //Someone has their time set under 1 second. ;P
    ShowMsg("Announcer has been disabled. Please insure you have the config set right!");
    }

    }





    Setup.h
    Code:
    void SetupAnnouncer(ScriptMgr * mgr);
    void ShowMsg(char * errmsg);



    Add to Char Table
    Code:
    CREATE TABLE `announcer_txt` (
    `id` int(3) NOT NULL auto_increment,
    `body` tinytext NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;




    And it should work

    Aka Milation

    These ads disappear when you log in.

  2. #2
    Gastricpenguin's Avatar Account not activated by Email
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what happen
    Last edited by Gastricpenguin; 08-07-2008 at 10:35 AM.

  3. #3
    Cursed's Avatar Contributor
    Reputation
    270
    Join Date
    Jun 2007
    Posts
    1,380
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This isnt Hellgawd? Ok the picture remind me of him but since Hellgawd isnt banned and has no 2nd acc afaik...

    Oh and please use CODE tags

  4. #4
    Fan Boi's Avatar Sergeant
    Reputation
    5
    Join Date
    Jul 2008
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Credits maybe? This is from the old ascent forums.

  5. #5
    Gastricpenguin's Avatar Account not activated by Email
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HOLY CRAP. When i first opened this thread it WAS hellgawd that was the OP!!! :O
    How did that happen?!?

  6. #6
    Silentnvd's Avatar Member
    Reputation
    49
    Join Date
    Jan 2008
    Posts
    295
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    whats the point of this script??

  7. #7
    Cripto's Avatar Master Sergeant
    Reputation
    33
    Join Date
    Jul 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i said death thats the dude

    and this script is for auto talking npc that works for ascent realms and mangos realms
    Last edited by 2dgreengiant; 08-07-2008 at 03:49 PM. Reason: double post, merged

    Aka Milation

  8. #8
    FrozenWoW 01's Avatar Sergeant
    Reputation
    9
    Join Date
    Jul 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm a little confused with this. Do I just copy and paste that into notepad and save it in my scripts file as announcer.cpp? or do I have to edit it?
    DEMON BLOOD FUNSERVER

  9. #9
    Babbaa's Avatar Knight
    Reputation
    32
    Join Date
    Nov 2007
    Posts
    206
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to compile this.

  10. #10
    Fan Boi's Avatar Sergeant
    Reputation
    5
    Join Date
    Jul 2008
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It has SQL to go with it.

Similar Threads

  1. [Question] Any auto clickers that work with WOW Legion?
    By ShaunOfTheDeed in forum WoW Bots Questions & Requests
    Replies: 3
    Last Post: 08-17-2016, 07:39 AM
  2. WOTLK 6088+ that works with 8391 and transports work
    By Freyetta in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 06-15-2008, 10:25 AM
  3. Replies: 0
    Last Post: 01-09-2008, 10:41 PM
  4. Voice modifier that works with Ventrilo
    By murphy2122 in forum World of Warcraft General
    Replies: 6
    Last Post: 01-06-2008, 06:39 PM
  5. [Question] Currently working model edit fix? That works with 2.2?
    By mainevent101 in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-16-2007, 07:40 AM
All times are GMT -5. The time now is 10:44 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search