[Release] Player Levelup announcer menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Edude's Avatar Member
    Reputation
    98
    Join Date
    Jul 2008
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Release] Player Levelup announcer

    Hello fellow MMOwned users. I have been "afk" for a while, had to deal with the FrostTeam's website problems and all.


    For some time now, I have been stepping into C# and C++ and I will present my first C++ Script now.

    A BIG Thank You to Link_S, for helping me with some doubts ^^

    Code:
    /* 
    Author: Edude
    Date: 02/01/09
    Reason: Making a global announcement every time a player levels;
    BUNCH OF ERRORS SORTED OUT BY: Link_S
    */
    
    #include "StdAfx.h"
    #include "Setup.h"
    #include <ScriptSetup.h>
    
    #ifdef WIN32
    #pragma warning(disable:4305) // warning C4305: 'argument: truncation from 'double' to 'float'
    #endif
    
    void Charlvl(Player * Plr)
    {
    	char levelStr[1024];
    
    	uint32 plr_level = Plr->getLevel();    //Gets the new player level
    
    	switch(plr_level)
    	{
    	case 80:
    		snprintf(levelStr, "|cff00ccff%s|r is now level |cffff0000%s|r!", Plr->GetName(), Plr->getLevel()); 
    		sWorld.SendWorldText(levelStr);
    		Plr->BroadcastMessage("Congratulations! You are now level %s", Plr->GetLevel());
    
    		uint32 plr_money = Plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
    		if (Plr->getLevel() == 80)
    		{
    			uint32 player_money_gain = plr->getLevel() * 5000000; // 500 gold
    			Plr->SetUInt32Value(PLAYER_FIELD_COINAGE, player_money + player_money_gain);
    		}
    		break;
    	case 70:
    		snprintf(levelStr, "|cff00ccff%s|r is now level |cffff0000%s|r|", Plr->GetName(), Plr->getLevel());
    		sWorld.SendWorldText(levelStr);
    		Plr->BroadcastMessage("Congratulations! You are now level %s", Plr->GetLevel());
    		break;
    	case 55:
    		snprintf(levelStr, "|cff00ccff%s|r is now level |cffff0000%s|r| and can now create a Death Knight", Plr->GetName(), Plr->getLevel());
    		sWorld.SendWorldText(levelStr);
    		Plr->BroadcastMessage("Congratulations! You are now level %s", Plr->GetLevel());
    		break;
    	}
    }
    
    void SetupCharlvl(ScriptMgr * mgr)
    {
    	mgr->register_hook(SERVER_HOOK_EVENT_ON_POST_LEVELUP, &Charlvl);
    
    }
    Remember, this is my FIRST C++ Script, so be nice with me.

    Happy New Year folks =)
    Last edited by Edude; 01-05-2009 at 11:50 AM.

    [Release] Player Levelup announcer
  2. #2
    Nymphx's Avatar Active Member
    Reputation
    83
    Join Date
    Sep 2008
    Posts
    212
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simple but very nice +Rep

  3. #3
    keazain's Avatar Banned
    Reputation
    234
    Join Date
    Jun 2008
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice done +rep

  4. #4
    Couwae's Avatar Active Member
    Reputation
    32
    Join Date
    Sep 2007
    Posts
    470
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    __________
    Last edited by Couwae; 01-18-2023 at 06:07 PM.


  5. #5
    Edude's Avatar Member
    Reputation
    98
    Join Date
    Jul 2008
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ## If a player reaches level 55, it will announce:
    -- "(plrname) has reached levell 55 and can now create a Death Knight!"

    ## If a player reaches level 70, it will announce:
    .. "(Plrname) has reached level 70!"

    ## If a player reaches level 80, it will announce:
    -- "(plrname) has reached level 80!"


    Very simple ^^

  6. #6
    Edude's Avatar Member
    Reputation
    98
    Join Date
    Jul 2008
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all the feedback by the way >.<

  7. #7
    Mango Jerry's Avatar Banned
    Reputation
    192
    Join Date
    Jan 2008
    Posts
    1,244
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude, thats a very nice Script!
    Keep it up.

  8. #8
    Djfrederick's Avatar Banned
    Reputation
    127
    Join Date
    Sep 2008
    Posts
    380
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pew pew, +Rep

  9. #9
    stresss's Avatar Member
    Reputation
    1
    Join Date
    May 2008
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice work man, keep it up

  10. #10
    Link_S's Avatar Member
    Reputation
    125
    Join Date
    Dec 2008
    Posts
    293
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You finally got it. +Rep

  11. #11
    VictoRo's Avatar Contributor
    Reputation
    81
    Join Date
    Feb 2008
    Posts
    219
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice mate +rep for you (;

  12. #12
    Edude's Avatar Member
    Reputation
    98
    Join Date
    Jul 2008
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your feedback =)

  13. #13
    bsod-staff14's Avatar Member
    Reputation
    35
    Join Date
    Nov 2008
    Posts
    443
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice thanks bro +Rep also sorry about the site but I need a little help if you could get someone from the team that does PS to give me a hand with buttons and images for the bg that would be wonderful and once again thanks.
    Immortal GamerZ Under Development!

  14. #14
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should use a switch statement instead of 3 if statements

  15. #15
    Edude's Avatar Member
    Reputation
    98
    Join Date
    Jul 2008
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ye, TheSpidey, gonna change that in a moment,

    Thanks =)

    EDIT: Changed ^^
    Last edited by Edude; 01-03-2009 at 09:37 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Release] Players Start with Season 1 Weapons
    By Lilltimmy in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 06-28-2008, 11:58 AM
  2. [Release] Ascent Auto Announcer
    By Pwntzyou in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 05-21-2008, 12:35 PM
  3. [Release] Player Create Info Goodies
    By Creepfold in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-02-2008, 04:48 AM
  4. [Release] Player Create Starter Kit
    By Corosive720 in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 12-29-2007, 06:33 AM
  5. [Release] Player Create Spells
    By toxic11b in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 12-19-2007, 02:16 PM
All times are GMT -5. The time now is 05:53 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search