PDA

View Full Version : [Share/Release] Gamble NPC


Double
03-28-2009, 07:06 PM
============
===Credits=====
============

Created by Mircast---
~~[[Credits: Sandile for the Idea]]

============
==Screenshots==
============

http://img27.imageshack.us/img27/7780/lol1m.jpg (http://img27.imageshack.us/my.php?image=lol1m.jpg)
http://img27.imageshack.us/img27/lol1m.jpg/1/w687.png (http://g.imageshack.us/img27/lol1m.jpg/1/)

http://img7.imageshack.us/img7/7510/lol2g.jpg (http://img7.imageshack.us/my.php?image=lol2g.jpg)
http://img7.imageshack.us/img7/lol2g.jpg/1/w687.png (http://g.imageshack.us/img7/lol2g.jpg/1/)

http://img27.imageshack.us/img27/6864/lol4y.jpg (http://img27.imageshack.us/my.php?image=lol4y.jpg)
http://img27.imageshack.us/img27/lol4y.jpg/1/w687.png (http://g.imageshack.us/img27/lol4y.jpg/1/)

http://img27.imageshack.us/img27/3955/lol5s.jpg (http://img27.imageshack.us/my.php?image=lol5s.jpg)
http://img27.imageshack.us/img27/lol5s.jpg/1/w687.png (http://g.imageshack.us/img27/lol5s.jpg/1/)

============
=Intallation Guide=
============

1. Execute this SQL into your "world" database

insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`)
values ('98231', "Bananas", "Gambler", '', '0', '1', '0', '0', '0', '0', '21362', '0', '0', '0', '1', '1', '0', '0');

insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`)
values ('98231', '84', '84', '35', '1', '1', '0', '1', '1', '1900', '0', '100', '200', '0', '0', '0', '0', '3600000', '1', '0', '0', '0', '0', '0', '0', '0', '0', "0", '0', '0', '0', '0', '2.50', '8.00', '14.00', '0', '0', '0', '0', '0', '0', '0');

2. Put this LUA file in your "scripts" folder.

function On_Gossip(unit, event, player)
unit:RemoveEvents()
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("Sorry, you have to leave combat first!")
else
unit:GossipCreateMenu(100, player, 0)
unit:GossipMenuAddItem(5, "[Bet 1 Coin]", 1, 0)
unit:GossipMenuAddItem(5, "[Bet 2 Coins]", 2, 0)
unit:GossipMenuAddItem(5, "[Bet 5 Coins]", 3, 0)
unit:GossipSendMenu(player)
end
end

function Gossip_Submenus(unit, event, player, id, intid, code)

if (intid == 7) then
unit:GossipCreateMenu(100, player, 0)
unit:GossipMenuAddItem(5, "[Bet 1 Coin]", 1, 0)
unit:GossipMenuAddItem(5, "[Bet 2 Coins]", 2, 0)
unit:GossipMenuAddItem(5, "[Bet 5 Coins]", 3, 0)
unit:GossipSendMenu(player)
end

if (intid == 3) then
if (player:GetItemCount(ITEMID) < 5) then
player:SendAreaTriggerMessage("You don't have enough coins to bet!")
else
unit:GossipCreateMenu(100, player, 0)
unit:GossipMenuAddItem(4, "Bet 5 Coins", 8, 0)
unit:GossipMenuAddItem(4, "[BACK]", 7, 0)
unit:GossipSendMenu(player)
end
end

if (intid == 8) then
Choice=math.random(1, 4)
if Choice==1 then
player:SendAreaTriggerMessage("You won (5) Coins! You gambling whore!")
unit:FullCastSpellOnTarget(33082, player)
unit:FullCastSpellOnTarget(33081, player)
unit:FullCastSpellOnTarget(33077, player)
unit:FullCastSpellOnTarget(33078, player)
unit:FullCastSpellOnTarget(33079, player)
unit:FullCastSpellOnTarget(33080, player)
player:AddItem(ITEMID, 5)
end
if Choice==2 then
player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
player:RemoveItem(ITEMID, 5)
end
if Choice==3 then
player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
player:RemoveItem(ITEMID, 5)
end
if Choice==4 then
player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
player:RemoveItem(ITEMID, 5)
end
end

if (intid == 1) then
if (player:GetItemCount(ITEMID) < 1) then
player:SendAreaTriggerMessage("You don't have enough coins to bet!")
else
unit:GossipCreateMenu(100, player, 0)
unit:GossipMenuAddItem(4, "Bet 1 Coin", 5, 0)
unit:GossipMenuAddItem(4, "[BACK]", 7, 0)
unit:GossipSendMenu(player)
end
end

if (intid == 5) then
Choice=math.random(1, 2)
if Choice==1 then
player:SendAreaTriggerMessage("You won (1) Coin!")
player:AddItem(ITEMID, 1)
end
if Choice==2 then
player:SendAreaTriggerMessage("You lost (1) Coin, better luck next time!")
player:RemoveItem(ITEMID, 1)
end
end

if (intid == 2) then
if (player:GetItemCount(ITEMID) < 2) then
player:SendAreaTriggerMessage("You do not have enough coins to bet!")
else
unit:GossipCreateMenu(100, player, 0)
unit:GossipMenuAddItem(4, "Bet 2 Coins", 6, 0)
unit:GossipMenuAddItem(4, "[BACK]", 7, 0)
unit:GossipSendMenu(player)
end
end

if (intid == 6) then
Choice=math.random(1, 2)
if Choice==1 then
player:SendAreaTriggerMessage("You won (2) Coins!")
player:AddItem(ITEMID, 2)
end
if Choice==2 then
player:SendAreaTriggerMessage("You lost (2) Coins, better luck next time!")
player:RemoveItem(ITEMID, 2)
end
end

RegisterUnitGossipEvent(98231 1, "On_Gossip")
RegisterUnitGossipEvent(98231 2, "Gossip_Submenus")

Entry ID:98231

This is something I found on MMoWned

Tyle
03-28-2009, 07:23 PM
lol if this works then + rep for posting it ;)

Double
03-28-2009, 07:25 PM
=] It worked for me. I love it Oh I almost forgot, the entry ID is 98231

QQrofl
03-28-2009, 07:41 PM
To bad sometimes the math.random choice= on every script sometimes makes you lose or win twice. Look's nice though. :)

Double
03-28-2009, 07:57 PM
Lol I knew you'd like it QQrofl. Can't wait till Conan Vegas

QQrofl
03-28-2009, 07:59 PM
Yeah, thanks. I still need to make the poker Npc's and stuff.

Tyle
03-28-2009, 09:27 PM
lol it doesnt work.. i meen i gatta mod it all together. :(

can you maybe add your Script and NPC to Rapidshare or Filefront?

Double
03-29-2009, 01:46 AM
Sure. I'll do it right now. Although I don't see a difference xD

Mikeambrose3
03-29-2009, 01:57 AM
Lol +REP.
Nice Work.
I am definitely QQ'ing right now!

Double
03-29-2009, 04:04 AM
lol thanks Mike

lordcranberry3
03-30-2009, 06:19 PM
nice job=)

mistahellfire
04-10-2009, 04:58 AM
where do i put the LUA Script? you didnt give us an LUA file

bidudu94
09-23-2009, 09:21 AM
i done evreythign you said, putted script in "script" and when i spawn The Gambler (banana) nothing Appears , When i Click on Npc He just Dosint Say Gamble 1 Coin Etc... any ideas?

Alvanaar
09-23-2009, 09:48 AM
Possibly because this is a very old post.

Lbniese
10-25-2009, 07:48 AM
repost :(