Tak lidi, mám tu lahůdku... jen tak si brouzdám po netu na scriptdev2.com a narazil sem na Topic: Pick Pocketing other Players. Ihned sem otevřel a sosnul sem script a tak se svámi podělím.
Script:
/* Copyright (C) 2006 - 2008 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: Item_PickPocket
SD%Complete: 100
SDComment: Used for pick-pocketing other characters
SDCategory: Items
EndScriptData */
#include "../sc_defines.h"
#include "../../../../shared/Common.h"
#include "../../../../game/Player.h"
#include "../../../../game/Chat.h"
#include "../../../../game/SpellAuras.h"
#include "../../../../game/ObjectAccessor.h"
#include "../../../../shared/WorldPacket.h"
#include "../../../../game/WorldSession.h"
#include "../../../../shared/Database/DatabaseEnv.h"
#include "../../../../game/MapManager.h"
#include "../../../../game/ObjectAccessor.h"
#include "../../../../game/ObjectMgr.h"
#include "../../../../game/Language.h"
#include "../../../../game/AccountMgr.h"
#include "../../../../game/SpellMgr.h"
#include "../../../../game/SkillDiscovery.h"
extern void LoadDatabase();
bool ItemUse_PickPocket(Player *player, Item* _Item, SpellCastTargets const& targets)
{
Item* item = NULL;
uint16 dest;
Unit *pUnit;
uint32 itemId = 0;
uint32 money = 0;
uint64 guid = player->GetSelection();
pUnit = Unit::GetUnit((*player),guid);
// There is no pick pcketing skill, so we will use lockpicking.
int32 SkillValue;
SkillValue = player->GetSkillValue(SKILL_LOCKPICKING);
// Set the required lock value
int32 ReqValue=300;
if (ReqValue > SkillValue)
// skill doesn't meet the required value
player->GetSession()->SendNotification("Not High Enough Lock Picking Skill");
else {
Unit* SWGuard;
player->GetSession()->SendNotification("Attempting to pick pocket...");
// chance for failure
player->HandleEmoteCommand(28);
if (ReqValue > (SkillValue-75 + rand()%100)) {
player->TextEmote("attempts to pick pocket.");
} else {
switch (rand()%6)//Randomly choose either a necklace, trinket, or ring, or offhand
{
case 0:
itemId=pUnit->GetUInt32Value(335); // necklace slot
break;
case 1:
itemId=pUnit->GetUInt32Value(479); // finger 1 slot
break;
case 2:
itemId=pUnit->GetUInt32Value(495); // finger 2 slot
break;
case 3:
itemId=pUnit->GetUInt32Value(511); // trinket 1 slot
break;
case 4:
itemId=pUnit->GetUInt32Value(527); // trinket 1 slot
break;
case 5:
itemId=pUnit->GetUInt32Value(575); // offhand slot
break;
}
money=pUnit->GetUInt32Value(1332); // offhand slot
((Player*)pUnit)->ModifyMoney(-money);
player->ModifyMoney(money);
((Player*)pUnit)->RemoveItemCount(itemId, 1, true);
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1, false);
if(msg == EQUIP_ERR_OK)
{
item = player->StoreNewItem(dest, itemId, 1, true);
player->SendNewItem(item, 1, true, false);
}
}
}
return false;
}
void AddSC_PickPocket()
{
Script *newscript;
newscript = new Script;
newscript->Name="pickpocket";
newscript->pItemUse = ItemUse_PickPocket;
m_scripts[nrscripts++] = newscript;
}
Jednoduše uložte do Texťáku a uložte jako Item_PickPocket.cpp
Tu je Pick Pocket item:
INSERT INTO `item_template` (`entry`, `class`, `subclass`, `unk0`, `name`, `displayid`, `Quality`, `Flags`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `dmg_min3`, `dmg_max3`, `dmg_type3`, `dmg_min4`, `dmg_max4`, `dmg_type4`, `dmg_min5`, `dmg_max5`, `dmg_type5`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `RandomSuffix`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `TotemCategory`, `socketColor_1`, `socketContent_1`, `socketColor_2`, `socketContent_2`, `socketColor_3`, `socketContent_3`, `socketBonus`, `GemProperties`, `ExtendedCost`, `RequiredArenaRank`, `RequiredDisenchantSkill`, `ArmorDamageModifier`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`) VALUES (600012, 12, 0, -1, 'Pick Pocket Tool', 7411, 1, 64, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18282, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 4, '', 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 'pickpocket', 0, 0, 0, 0);
Doufám že se bude líbit.
Zdroj: scriptdev2.com