PDA

View Full Version : [Re-Release]:Pvp Token Script


benny93
05-12-2009, 08:19 PM
Re-releasing a c++ Pvp token script cuse ppl have Requesting it on the forum :)

Dont know how to compile? Read QQrofl's Compiling Scripthttp://www.ac-web.org/forums/tutorials/52629-tut-pictures-how-compile-c-scripts-following-your-extrascripts-folder.html

Tokens.cpp
//Projectfile remade by Keazain

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

#define TokenID 29434
#define amt 1

void addToken(Player* pPlayer)
{
int RandomNumberGenerator = RandomUInt(100);

ItemPrototype* it = ItemPrototypeStorage.LookupEntry(TokenID);
Item * add = pPlayer->GetItemInterface()->FindItemLessMax(TokenID, amt, false);
SlotResult slotresult = pPlayer->GetItemInterface()->FindFreeInventorySlot(it);

if(RandomNumberGenerator <= 50)
{
pPlayer->BroadcastMessage("You have gained a token.");
if (!add)
{
if(!slotresult.Result)
{
pPlayer->GetItemInterface()->BuildInventoryChangeError(NULL, NULL, INV_ERR_INVENTORY_FULL);
} else {
Item *item = objmgr.CreateItem( TokenID, pPlayer);
item->SetUInt32Value( ITEM_FIELD_STACK_COUNT, amt );
if( pPlayer->GetItemInterface()->SafeAddItem( item, slotresult.ContainerSlot, slotresult.Slot ))
{
pPlayer->GetSession()->SendItemPushResult(item,false,true,true,true,slotr esult.ContainerSlot,slotresult.Slot,1);
sQuestMgr.OnPlayerItemPickup(pPlayer,item);
} else {
item->DeleteMe();
}
}
} else {
add->SetCount(add->GetUInt32Value(ITEM_FIELD_STACK_COUNT) + amt);
add->m_isDirty = true;
pPlayer->GetSession()->SendItemPushResult(add, false, true, true, false, pPlayer->GetItemInterface()->GetBagSlotByGuid(add->GetGUID()), 0xFFFFFFFF, 1);
}
} else {
pPlayer->BroadcastMessage("You have not gained a token.");
}
}

void SetupTokens(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)addToken);
}


setup.cpp
//Projectfile remade by Keazain

#include "StdAfx.h"
#include "Setup.h"
#define SKIP_ALLOCATOR_SHARING 1
#include <ScriptSetup.h>

extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}

extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
SetupTokens(mgr);
}

#ifdef WIN32

BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}

#endif



Setup.H file
//Projectfile remade by Keazain

#ifndef INSTANCE_SCRIPTS_SETUP_H
#define INSTANCE_SCRIPTS_SETUP_H

void SetupTokens(ScriptMgr * mgr);


#endif


Download link MEGAUPLOAD - The leading online storage and file delivery service (http://www.megaupload.com/?d=2S5PMM05)

All Rep Goes to Keazain for Creating This Script


All Rep Goes to QQrofl for Creating the Compiling Guide

bbishop93
05-12-2009, 08:50 PM
so what this just a pvp token which gms will just give to players when the win pvp even or sumthing...btw if i wanted to how could i make this custom pvp token be a price for an item. I know the extended cost ids but how do u do it with a custom item.

btw +rep nice job.

benny93
05-12-2009, 09:30 PM
so what this just a pvp token which gms will just give to players when the win pvp even or sumthing...btw if i wanted to how could i make this custom pvp token be a price for an item. I know the extended cost ids but how do u do it with a custom item.

btw +rep nice job.

., no , its a c++ script that allows u to get a token of ur choice ex [Badge of Justice 29434] (easy edited in the script) when you kill a player of the opposing faction in pvp :)

You cannot pick your own price for extended price.

If there is an NPC that sells something for 26 BOJ in the game you can charge 26 BOJ for anything

However if you want to charge 27 BOJ and there is no npc in wow that sells something for 27 BOJ then your SOL.

But it's really simple.
1. First you pick the item you want to have an extended cost.
2. Now make the buy value 0 and the sell value 1.
3. Now add an item to a vendor (either with .npc vendoradditem or a sql)
4. Next you go into 'Vendors' in your database and sort 'entry' decending (since most new vendors are at the bottom)
5. Find your vendors entry number.
6. Find your item's entry number under 'item'
7. Look at the last column. It's called extended_cost.
8. Put 1 of the numbers from below into that field and now it will be sold for badges or whatever you choose to use

Edit: Oh and you can modify the badges. As long as you DONT modify the entryid of the BOJ. So if you want to make a BOJ Legendary and Not BOP and called "IM SO COOL I CAN CHANGE NAMES" you can do it no problem. You can even change the displayID and turn a BOJ into some tough jerky. But do not under any circumstances change the entryid. Sorry it's not what you asked but still good to know. The db does not care about anything but the entryid for extended cost.


Here is some extended costs for BOJ's.
Not sure if it's all of them but should be enough to start.

10 = 1909
15 = 1642
20 = 1452
25 = 1015
30 = 1454
33 = 1037
35 = 2059
41 = 1027
45 = 2332
60 = 2059
75 = 2049
100 = 2333
105 = 2331
150 = 2329

benny93
05-12-2009, 09:31 PM
so what this just a pvp token which gms will just give to players when the win pvp even or sumthing...btw if i wanted to how could i make this custom pvp token be a price for an item. I know the extended cost ids but how do u do it with a custom item.

btw +rep nice job.


2353 Burning Blossom 350
2352 Burning Blossom 200
2351 Burning Blossom 100
2350 Burning Blossom 20
2349 Burning Blossom 5
2348 Burning Blossom 2
2347 Badge of Justicex40
2346-2334 unknown appears unused
2333 Badge of Justicex100
2332 Badge of Justicex45
2331 Badge of Justicex105
2330 Badge of Justicex125
2329 Badge of Justicex150
2328 Boots of the Forgotten Protectorx1
2327 Boots of the Forgotten Vanquisherx1
2326-2292 unknown
2291 Arathi Basin Mark of Honor 20
2290 Arathi Basin Mark of Honor 20
2289 Alterac Valley Mark of Honor 40
2288 Arena Points 1500
2287 Arena Points 2625
2286 Arena Points 1125
2285 Arena Points 1875
2284 Arena Points 3150
2283 Arena Points 1125
2282 Arena Points 3750
2281 Warsong Gulch Mark of Honor 30
2280 Alterac Valley Mark of Honor 30
2279 Arathi Basin Mark of Honor 30
2278 Arathi Basin Mark of Honor 20
2277 Alterac Valley Mark of Honor 20
2276 Brewfest Prize Token 200
2275 Brewfest Prize Token 100
2274 Brewfest Prize Token 50
2273 Brewfest Prize Token 600
2272 Apexis Shard 50
2271 Alterac Valley Mark of Honor 40
2270 Alterac Valley Mark of Honor 40
2269 Arathi Basin Mark of Honor 20
2268 Arathi Basin Mark of Honor 20
2267 Arathi Basin Mark of Honor 20
2266 Arathi Basin Mark of Honor 20
2265 Warsong Gulch Mark of Honor 30
2264 Warsong Gulch Mark of Honor 30
2263 Alterac Valley Mark of Honor 30
2262 Alterac Valley Mark of Honor 30
2261 Alterac Valley Mark of Honor 20
2260 Alterac Valley Mark of Honor 20
2259 Arathi Basin Mark of Honor 30
2258 Arathi Basin Mark of Honor 30
2257 Alterac Valley Mark of Honor 40
2256 Alterac Valley Mark of Honor 40
2255 Eye of the Storm Mark of Honor 20
2254 Eye of the Storm Mark of Honor 20
2253 Alterac Valley Mark of Honor 10
2252 Eye of the Storm Mark of Honor 10
2251 Warsong Gulch Mark of Honor 20
2250 Eye of the Storm Mark of Honor 40
2249 Arathi Basin Mark of Honor 40
2248 Eye of the Storm Mark of Honor 10
2242 Eye of the Storm Mark of Honor 20
2241 Eye of the Storm Mark of Honor 10
2240 Eye of the Storm Mark of Honor 20
2239 Eye of the Storm Mark of Honor 20
2238 Eye of the Storm Mark of Honor 20
2237 Alterac Valley Mark of Honor 40
2236 Halaa Research Token 4
2060 Badge of Justice 35
2059 Badge of Justice 60
2049 Badge of Justice 75
2028 Alterac Valley Mark of Honor 10
1994 Glowcap 10
1992 Spirit Shard 2
1985 Apexis Crystal 3
1981 Apexis Crystal 4
1979 Apexis Shard 160
1973 Apexis Shard 40
1963 Coilfang Armaments 1
1959 Mark of the Illidari 1
1958 Apexis Shard 10
1952 Apexis Crystal 1
1950 Apexis Crystal 4
1949 Apexis Shard 2
1948 Apexis Shard 3
1935 Warsong Gulch Mark of Honor 20
1923 Arathi Basin Mark of Honor 40
1911 Eye of the Storm Mark of Honor 40
1910 Apexis Shard 35
1909 Badge of Justice 10
1765 Halaa Research Token 2
1758 Arena Points 1000
1757 Arena Points 3150
1670 Arena Points 2625
1664 Arena Points 3750
1653 Warsong Gulch Mark of Honor 2
1652 Eye of the Storm Mark of Honor 2
1649 Alterac Valley Mark of Honor 2
1648 Arathi Basin Mark of Honor 2
1647 Halaa Battle Token 70
1646 Halaa Battle Token 100
1645 Silken Thread 1
1642 Badge of Justice 15
1565 Unused
1564 Unused
1524 Pauldrons of the Forgotten Vanquisher
1523 Leggings of the Forgotten Vanquisher
1522 Chestguard of the Forgotten Vanquisher
1521 Helm of the Forgotten Vanquisher
1520 Gloves of the Forgotten Vanquisher
1497 Pauldrons of the Forgotten Conqueror
1494 Leggings of the Forgotten Conqueror
1491 Chestguard of the Forgotten Conqueror
1488 Helm of the Forgotten Conqueror
1485 Gloves of the Forgotten Conqueror
1482 Pauldrons of the Forgotten Protector
1480 Leggings of the forgotten Protector
1478 Chestguard of the forgotten Protector
1476 Helm of the Forgotten Protector
1474 Gloves of the Forgotten Protector
1468 Murloc Fin 60
1454 Badge of Justice 30
1452 Badge of Justice 20
1442 Warsong Gulch Mark of Honor 60
1435 Arena Points 1500
1432 Arena Points 1125
1361 Pauldrons of the Vanquished Hero
1360 Leggings of the Vanquished Hero
1359 Chestguard of the Vanquished Hero
1358 Helm of the Vanquished Hero
1357 Gloves of the Vanquished hero
1346 Pauldrons of the Vanquished Champion
1345 Leggings of the Vanquished Champion
1344 Chestguard of the Vanquished Champion
1343 Helm of the Vanquished CHampion
1342 Gloves of the Vanquished Champion
1336 Pauldrons of the Vanquished Defender
1335 Leggings of the Vaquished Defender
1334 Chestguard of the Vanquished Defender
1333 Helm of the Vanquished Defender
1332 Gloves of the Vanquished Defender
1243 Pauldrons of the Fallen Defender
1241 Leggings of the Fallen Defender
1239 Chestguard of the Fallen Defender
1237 Helm of the Fallen Defender
1235 Gloves of the Fallen Defender
1219 Pauldrons of the Fallen Hero
1218 Leggings of the Fallen Hero
1217 Chestguard of the Fallen Hero
1216 Helm of the Fallen Hero
1215 Gloves of the Fallen Hero
1212 Pauldrons of the Fallen Champion
1209 Leggings of the Fallen Champion
1206 CHestguard of the Fallen Champion
1203 Helm of the Fallen Champion
1200 Gloves of the Fallen Champion
1196 Arcane Rune 8
1192 Arcane Rune 2
1188 Holy Dust 8
1184 Holy Dust 2
1111 Warsong Gulch Mark of Honor 30
1110 Arathi Basin Mark of Honor 30
1077 Glowcap 45
1076 Glowcap 20
1062 Alterac Valley Mark of Honor 20
1061 Arathi Basin Mark of Honor 20
1055 Warsong Gulch Mark of Honor 30
1054 Warsong Gulch Mark of Honor 30
1050 Arathi Basin Mark of Honor 10
1040 Badge of Justice 50
1037 Badge of Justice 33
1027 Badge of Justice 41
1015 Badge of Justice 25
1009 Warsong Gulch Mark of Honor 60
1007 Arathi Basin Mark of Honor 3
1006 Alterac Valley Mark of Honor 20
1005 Alterac Valley Mark of Honor 50
1003 Alterac Valley Mark of Honor 60
1002 Alterac Valley Mark of Honor 30
1000 Arathi Basin Mark of Honor 60
990 Warsong Gulch Mark of Honor 20
989 Warsong Gulch Mark of Honor 20
986 Arathi Basin Mark of Honor 10
968 Warsong Gulch Mark of Honor 30
947 Arathi Basin Mark of Honor 30
933 Arathi Basin Mark of Honor 20
931 Warsong Gulch Mark of Honor 10
930 Warsong Gulch Mark of Honor 20
929 Warsong Gulch Mark of Honor 40
917 Warsong Gulch Mark of Honor 30
901 Arathi Basin Mark of Honor 30
887 Arathi Basin Mark of Honor 20
885 Warsong Gulch Mark of Honor 10
884 Warsong Gulch Mark of Honor 20
883 Warsong Gulch Mark of Honor 40
871 Warsong Gulch Mark of Honor 30
855 Arathi Basin Mark of Honor 30
841 Arathi Basin Mark of Honor 20
839 Warsong Gulch Mark of Honor 10
838 Warsong Gulch Mark of Honor 20
837 Warsong Gulch Mark of Honor 40
826 Warsong Gulch Mark of Honor 30
823 Warsong Gulch Mark of Honor 10
822 Warsong Gulch Mark of Honor 20
821 Warsong Gulch Mark of Honor 40
774 Arathi Basin Mark of Honor 10
748 Warsong Gulch Mark of Honor 40
747 Warsong Gulch Mark of Honor 30
746 Arathi Basin Mark of Honor 40
702 Alterac Valley Mark of Honor 25
701 Warsong Gultch Mark of Honor 30
653 Warsong Gultch Mark of Honor 30
652 Arathi Basin Mark of Honor 30
634 Honor 2805
567 Arathi Basin Mark of Honor 40
565 Arathi Basin Mark of Honor 20
542 Warsong Gultch Mark of Honor 30
541 Alterac Valley Mark of Honor 20
533 Alterac Valley Mark of Honor 20
532 Atlerac Valley Mark of Honor 10
520 Arathi Basin mark of Honor 30
501 Arathi Basin Mark of Honor 40
497 Alterac Valley Mark of Honor 15
496 Alterac Valley Mark of Honor 10
495 Arathi Basin Mark of Honor 20
492 Warsong Gultch Mark of Honor 10
491 Warsong Gultch Mark of Honor 20
490 Warsong Gultch Mark of Honor 40
489 Alterac Valley Mark of Honor 25
488 Warsong Gultch Mark of Honor 20
465 Arathi Basin Mark of Honor 20
464 Alterac Valley Mark of Honor 30
463 Arathi Basin Mark of Honor 30
460 Honor 1
444 Alterac Valley Mark of Honor 30
428 Alterac Valley Mark of Honor 20
427 Arathi Basin mark of Honor 20
423 Alterac Valley Mark of Honor 30
388 Glowcap 30
386 Honor 15300
360 ALterac Valley Mark of Honor 40
359 Honor 15300 + Eye of the Storm Mark of Honor 20
348 Eye of the Storm Mark of Honor 20
298 Spirit Shard 8
293 SPirit Shard 50
205 Arathi Basin Mark of Honor 20
204 Warsong Gultch Mark of Honor 30
203 Alterac Valley Mark of Honor 30
202 Alterac Valley Mark of Honor 20
201 Arathi Basin Mark of Honor 30
194 Spirit Shard 18
173 Honor 12750
172 Arathi Basin Mark of Honor 40
171 Eye of the Storm Mark of Honor 40
170 Honor 9435
169 Warsong Gultch Mark of Honor 20
165 Arathi Basin Mark of Honor 20
148 Arena Points 2739
146 Arena Points 870
133 Arena Points 2283
131 Alterac Valley Mark of honor 40
129 Alterac Valley Mark of honor 10
127 Eye of the Storm Mark of Honor 10
125 Eye of the Storm Mark of Honor 10
115 Honor 16983
104 Glowcap 15
103 Glowcap 25
102 Glowcap 2
100 Glowcap 1
99 Honor 8500
98 Honor 22950
95 Honor 6885
94 Honor 19125
77 Mark of Honor Hold 30
76 Mark of Thrallmar 30
69 Mark of Honor Hold 15
66 Honor 1 & Arena Points 1
65 Mark of Thrallmar 15
56 Mark of Honor Hold 10
55 Mark of Thrallmar 10
54 Mark of Thrallmar 5
53 Mark of Honor hold 5
26 Arena Points 3261
24 Arena Points 1304
22 Arena Points 1630
21 Arena Points 978
18 Halaa Battle Token 100
7 Halaa Research Token 8
6 Halaa Battle Token 20
5 Halaa Battle Token 40
2 Unused
1 Tough Jerky 1

2425 Alterac valley mark of honor 10
2424 Alterac Valley Mark of Honor 5
2412-2407 unknown
2406 Eye of the Storm Mark of Honor 40
2405 Eye of the Storm mark of Honor 20
2402 Alterac Valley Mark of Honor 10
2401 Warsong Gulch Mark of Honor 20
2400 Eye of the Storm Mark of Honor 40
2399 Brewfest Prize Token 20
2398 Brewfest Prize Token 2
2397 Brewfest Prize Token 200
2393-2354 unknown appears unused
2546 - Stone Keeper's Shardx30
2547 - Stone Keeper's Shardx15
2548 - Stone Keeper's Shardx100
2549 - Stone Keeper's Shardx40
2550 - Emblem of Heroismx200
2551 - Emblem of Heroismx65
2552 - Stone Keeper's Shardx300
2553 - Dream Shardx4
2554 - Dream Shardx10
2555 - Heavy Borean Leatherx3
2556 - Arctic Furx2
2557 - Honor 2500
2558 - Dalaran Jewelcrafter's Tokenx6
2559 - Honor 49600
2560 - Honor 31600
2561 - Honor 38000
2562 - Honor 62000
2564 - Honor 39400
2565 - Honor 47400
2568 - Honor 62000
2569 - Honor 60000
2570 - Honor 50000

Alvanaar
05-13-2009, 12:00 AM
benny, one question. Why did you release this, when, on the same page of the Scripts forum my PvP token script is?

slade1000
05-13-2009, 12:07 AM
he wanted to re-release it to make sure peolpe got the message that there is a pvp token script lol

Alvanaar
05-13-2009, 04:52 AM
People that can't scroll down! :)

Oh well...

benny93
05-13-2009, 06:43 AM
benny, one question. Why did you release this, when, on the same page of the Scripts forum my PvP token script is?


Im sorry Alvanaar, didnt think of posting a link to *your* post instead of posting the whole think , will ask you before next time , my mistake /benny

Alvanaar
05-16-2009, 07:35 AM
No problem :) Haha.

thomas2001
06-18-2009, 03:41 PM
this is telling you how to compile a custom PvP token script, so i want to know what to put in the items_extendcost to make my item worth some PvP tokens. My PvP token ID is 123451, i want to make players get 50 per piece of armor. How would i do this? What would i put in the items_extendcost? Im on a Hearthstone Repack V2

Chillu
06-18-2009, 05:01 PM
You would need to find a extended cost with an amount of 50 already in the core.
Ex: 2272 Apexis Shard 50

Then go into your DB and replace the Apexis Shard with your PvP token.

Peace
Chillu

shadowpower
03-11-2010, 05:34 AM
omg , im so stu , how can i use this in Mangos please help me , im am stupid.

Kzan
03-11-2010, 11:31 PM
ugh, only useful for mangos/trinity really :)

Alvanaar's is much better

sihl
03-13-2010, 10:09 AM
How would I go about making this usable for TrinityCore?

Auxilium
03-13-2010, 12:15 PM
How would I go about making this usable for TrinityCore?

Edit the pointers.

sihl
03-13-2010, 08:56 PM
What is the Trinity equivalent of ScriptSetup.h and StdAfx.h?

goofzaur
07-30-2010, 08:12 PM
bump ! answer to the last post please :D i need to make it work for trinity

zetto23
09-16-2010, 12:36 PM
14>..\src\ExtraScripts\Tokens.cpp(37): error C2039: 'SetCount' : is not a member of 'Item'

14>..\src\ExtraScripts\Tokens.cpp(39): error C2039: 'SendItemPushResult' : is not a member of 'WorldSession'


i'm assuming this no longer works with current arcemu rev? (r3461)

SimpleYetEffective
09-16-2010, 12:41 PM
You are a dick for bumping this.