Need help with (Only leader of a group may cast that spell) c++ script menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Pieterkii's Avatar Member
    Reputation
    7
    Join Date
    Jan 2009
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with (Only leader of a group may cast that spell) c++ script

    Hi there, i'm looking for a c++ script that will only allow a player to cast a spell (ID = 1515) if the player is the leader of the group. If the player is not in a group they should also be able to cast it.\

    Here's a summary of what i want.

    Code:
    If (In_Group->GetGroup())                  //Caster is in a group
     if (Leader->GetLeader() == CasterGUID())   //Caster is the leader of the group
      CastSpell;                                             //Casts spell if player is leader
     else
     MessageCaster("Only the party leader may cast that spell");
    else
    Castspell;                         //Casts spell if player is not in a group
    i tried doing it myself, i couldn't do it, the code is horrible

    Need help with (Only leader of a group may cast that spell) c++ script
  2. #2
    Envoke's Avatar Contributor
    Reputation
    105
    Join Date
    Jan 2009
    Posts
    201
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You posted on ******* and I answered there also..

    Code:
    //Be sure to include Chat.h at the top of your script.
    #include "Chat.h"
    
    if(player->GetGroup())
    {
    
    if(player->GetGroup()->IsLeader())
    {
       player->CastSpell(player, 0, false);
    }
    else
    {
      ChatHandler(player->GetSession()).PSendSysMessage("You can not cast the spell");
    }
    
    }
    else
    {
      player->CastSpell(player, 0, false);
    }
    Owner and developer of LevelUp WoW Bot

  3. #3
    Pieterkii's Avatar Member
    Reputation
    7
    Join Date
    Jan 2009
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks man!

Similar Threads

  1. Need help with sig
    By sudnrage111 in forum Community Chat
    Replies: 0
    Last Post: 09-24-2006, 02:12 AM
  2. Need help with weapon model edit!
    By Chewbbaca in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-20-2006, 07:02 PM
  3. need help with model editing experts please
    By sportstud10124 in forum Community Chat
    Replies: 0
    Last Post: 08-10-2006, 09:30 PM
  4. need help with shammy talents
    By jason in forum World of Warcraft General
    Replies: 5
    Last Post: 07-19-2006, 02:02 AM
  5. Need Help with WoW Glider
    By paypal in forum World of Warcraft General
    Replies: 2
    Last Post: 07-07-2006, 02:08 AM
All times are GMT -5. The time now is 08:29 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