Moj prvý script na vymenu lvl.
Player pride klikne na svoj level .Playerovy to da lvl na 80 a da mu to item ktory ked da inemu hracovy a ten hrac ho aktivuje dostane ten level aky mal ten prvy hrac.
Moj problem ked npc da item hračovy je soulbound ale ked si ho pridam sam .add id tak soulbound nieje takze to npc mi furt da item ktory sa stane soulbound neviem to spravit nehelpne niekto ?
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: npc_class
SD%Complete: 100
SDComment: Used to change lvl to another players
SDCategory: NPC
EndScriptData */
#include "ScriptedPch.h"
#define GOSSIP_ITEM_81 "Vymen level z lvl 81"
#define GOSSIP_ITEM_82 "Vymen level z lvl 82"
#define GOSSIP_ITEM_83 "Vymen level z lvl 83"
#define GOSSIP_ITEM_84 "Vymen level z lvl 84"
#define GOSSIP_ITEM_85 "Vymen level z lvl 85"
#define GOSSIP_ITEM_86 "Vymen level z lvl 86"
#define GOSSIP_ITEM_87 "Vymen level z lvl 87"
#define GOSSIP_ITEM_INV "Na vymenu levelu potrebujete mat miesto v inventary.!"
bool GossipHello_npc_class(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_81, GOSSIP_SENDER_MAIN, 1);
pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_82, GOSSIP_SENDER_MAIN, 2);
pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_83, GOSSIP_SENDER_MAIN, 3);
pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_84, GOSSIP_SENDER_MAIN, 4);
pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_85, GOSSIP_SENDER_MAIN, 5);
pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_86, GOSSIP_SENDER_MAIN, 6);
pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_87, GOSSIP_SENDER_MAIN, 7);
pPlayer->ADD_GOSSIP_ITEM(1, GOSSIP_ITEM_INV, GOSSIP_SENDER_INFO, 8);
pPlayer->SEND_GOSSIP_MENU(3961,pCreature->GetGUID());
return true;
}
bool GossipSelect_npc_class(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
ItemPosCountVec dest;
uint8 msg = pPlayer->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 1000027, 1);
if(uiAction == 1){
if(pPlayer->getLevel() == 81){
pPlayer->SetLevel(80);
pPlayer->StoreNewItemInBestSlots(1000021, 1);
}else{
pCreature->MonsterWhisper("Nemas Level 81",pPlayer->GetGUID(),true);
}
}
if(uiAction == 2){
if(pPlayer->getLevel() == 82){
pPlayer->SetLevel(80);
pPlayer->StoreNewItemInBestSlots(1000022, 1);
}else{
pCreature->MonsterWhisper("Nemas Level 82",pPlayer->GetGUID(),true);
}
}
if(uiAction == 3){
if(pPlayer->getLevel() == 83){
pPlayer->SetLevel(80);
pPlayer->StoreNewItemInBestSlots(1000023, 1);
}else{
pCreature->MonsterWhisper("Nemas Level 83",pPlayer->GetGUID(),true);
}
}
if(uiAction == 4){
if(pPlayer->getLevel() == 84){
pPlayer->SetLevel(80);
pPlayer->StoreNewItemInBestSlots(1000024, 1);
}else{
pCreature->MonsterWhisper("Nemas Level 84",pPlayer->GetGUID(),true);
}
}
if(uiAction == 5){
if(pPlayer->getLevel() == 85){
pPlayer->SetLevel(80);
pPlayer->StoreNewItemInBestSlots(1000025, 1);
}else{
pCreature->MonsterWhisper("Nemas Level 85",pPlayer->GetGUID(),true);
}
}
if(uiAction == 6){
if(pPlayer->getLevel() == 86){
pPlayer->SetLevel(80);
pPlayer->StoreNewItemInBestSlots(1000026, 1);
}else{
pCreature->MonsterWhisper("Nemas Level 86",pPlayer->GetGUID(),true);
}
}
if(uiAction == 7){
if(pPlayer->getLevel() == 87){
pPlayer->SetLevel(80);
pPlayer->StoreNewItem(dest, 1000027, 2, false);
}else{
pCreature->MonsterWhisper("Nemas Level 87",pPlayer->GetGUID(),true);
}
}
return true;
}
void AddSC_npc_class()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_class";
newscript->pGossipHello = &GossipHello_npc_class;
newscript->pGossipSelect = &GossipSelect_npc_class;
newscript->RegisterSelf();
}