Advertisement
cressidagp

Ol Emma

Oct 11th, 2023
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.57 KB | None | 0 0
  1. '''
  2.  
  3. Engine: APE
  4. Zone: Stormwind City
  5. Creature: Ol Emma
  6.  
  7. '''
  8.  
  9. import arcemu
  10. import ArcPyMath as Math
  11. from arcemu import Unit
  12.  
  13. OL_EMMA_TEXTS = [
  14. "Seems like a hundred times a day I walk all the way to the well to get more water. No respect for their elders I tell ya.",
  15. "Jack and Jill my wrinkled patoot! I do all the water luggin' 'round here.",
  16. "Think I'm starting to wear a rut in the paving stones.",
  17. "One of these days I'm gonna drown him in that blue robe. And all his brooms too.",
  18. "O'course I'm talkin to myself. Only way to get decent conversation in this city.",
  19. "As if I don't have better things to do in my old age than carry buckets of water.",
  20. "Where's the water, Emma? Get the water, Emma? If'n it weren't fer me, that lot wouldn't know what water looks like.",
  21. "Deja vu.  For a moment, I thought I was back home... before the plague..."
  22. ]
  23.  
  24. OL_EMMA_STATE = {}
  25.  
  26. NPC_ID_OL_EMMA = 3520
  27.  
  28. def OlEmma_onReachWP( unit, event, waypointId, forward ):
  29.  
  30.     chance = Math.randomUInt( 99 )
  31.  
  32.     if chance < 10:
  33.  
  34.         guid = unit.getGUID()
  35.  
  36.         if guid not in OL_EMMA_STATE:
  37.             OL_EMMA_STATE[ guid ] = 0
  38.  
  39.         state = OL_EMMA_STATE[ guid ]
  40.  
  41.         if forward:
  42.             unit.sendChatMessage( arcemu.CHAT_MSG_MONSTER_SAY, arcemu.LANG_COMMON, OL_EMMA_TEXTS[ state ] )
  43.  
  44.         else:
  45.             unit.sendChatMessage( arcemu.CHAT_MSG_MONSTER_SAY, arcemu.LANG_COMMON, OL_EMMA_TEXTS[ state + 4 ] )
  46.  
  47.         if state == 3:
  48.                 state = 0
  49.        
  50.         else:
  51.                 state = state + 1
  52.  
  53.         OL_EMMA_STATE[ unit.getGUID() ] = state
  54.  
  55. arcemu.RegisterUnitEvent( NPC_ID_OL_EMMA, arcemu.CREATURE_EVENT_ON_REACH_WP, OlEmma_onReachWP )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement