SHOW:
|
|
- or go back to the newest paste.
| 1 | - | Function Testjens(pUnit, Event) |
| 1 | + | |
| 2 | - | pUnit:RegisterEvent("Harald_say", 200000, 0)
|
| 2 | + | -- ID of creature |
| 3 | local entryid = 1 -- should NEVER be 1 as it is - 1 is usually waypoint | |
| 4 | ||
| 5 | - | function Harald_say(pUnit, Event) |
| 5 | + | function HeraldSpawns(pUnit, Event) |
| 6 | - | local chance = math.random(1,4) |
| 6 | + | pUnit:RegisterEvent("SaySomethingHerald", 5000, 1)
|
| 7 | - | if(chance == 1) then |
| 7 | + | |
| 8 | - | pUnit:SendChatMessage(12, 0, "Got some spare change?") |
| 8 | + | |
| 9 | function SaySomethingHerald(pUnit) | |
| 10 | - | if(chance == 2) then |
| 10 | + | local chance = math.random(1,4) |
| 11 | - | pUnit:SendChatMessage(12, 0, "Mind your own business, pal!") |
| 11 | + | if(chance == 1) then |
| 12 | pUnit:SendChatMessage(12, 0, "Got some spare change?") | |
| 13 | - | if(chance == 3) then |
| 13 | + | elseif(chance == 2) then |
| 14 | - | pUnit:SendChatMessage(12, 0, "Are you looking for a fight, you prick?") |
| 14 | + | pUnit:SendChatMessage(12, 0, "Mind your own business, pal!") |
| 15 | elseif(chance == 3) then | |
| 16 | - | if(chance == 4) then |
| 16 | + | pUnit:SendChatMessage(12, 0, "Are you looking for a fight, you prick?") |
| 17 | - | pUnit:SendChatMessage(12, 0, "Come over here!") |
| 17 | + | elseif(chance == 4) then |
| 18 | pUnit:SendChatMessage(12, 0, "Come over here!") | |
| 19 | end | |
| 20 | pUnit:RegisterEvent("SaySomethingHerald", math.random(1000, 60000*5), 1) -- send a message every 0-5 minutes
| |
| 21 | - | function Name_Died(Unit, Event) |
| 21 | + | |
| 22 | - | Unit:RemoveEvents() |
| 22 | + | |
| 23 | function CreatureDieda(pUnit, Event) | |
| 24 | pUnit:RemoveEvents() | |
| 25 | - | RegisterUnitEvent(1, 18, "Testjens") |
| 25 | + | |
| 26 | - | RegisterUnitEvent(1, 4, "Name_Died") |
| 26 | + | |
| 27 | RegisterUnitEvent(entryid, 18, "HeraldSpawns") | |
| 28 | RegisterUnitEvent(entryid, 4, "CreatureDieda") |