Advertisement
cressidagp

Elders

Oct 14th, 2023 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.37 KB | None | 0 0
  1. '''
  2.  
  3. Engine: APE
  4. Zone: Stormwind City, Tirisfall Glades
  5. Creature: Ian Drake, Edward Cain
  6. .npc portto 120346 / .npc portto 120347
  7.  
  8. '''
  9.  
  10. import arcemu
  11. import ArcPyMath as Math
  12. from arcemu import GossipMenu
  13. from arcemu import Unit
  14.  
  15. ELDERS_TEXTS = [
  16. "You're secret code is not a valid one...",
  17. "I would like to whisper my secret code to you to receive Tyrael's Hilt."
  18. ]
  19.  
  20. NPC_ID_IAN_DRAKE = 29093
  21. NPC_ID_EDWARD_CAIN = 29095
  22. ITEM_ID_TYRAELS_HILT = 39656
  23.  
  24. def elders_onHello( unit, event, player ):
  25.  
  26.     menu = GossipMenu( 13441, unit, arcemu.GOSSIP_AUTOSEND_FALSE )
  27.  
  28.     menu.addItem( arcemu.ICON_CHAT, ELDERS_TEXTS[ event ], 0, 1 )
  29.  
  30.     menu.sendToPlayer( player )
  31.  
  32. def elders_onSelectOption( unit, player, id, enteredCode ):
  33.  
  34.     if enteredCode == '69':
  35.  
  36.         player.addItem( ITEM_ID_TYRAELS_HILT, 1 )
  37.  
  38.     else:
  39.         unit.sendChatMessage( arcemu.CHAT_MSG_MONSTER_SAY, arcemu.LANG_UNIVERSAL, ELDERS_TEXTS[ 0 ] )
  40.  
  41.     GossipMenu.complete( player )
  42.            
  43. arcemu.RegisterUnitGossipEvent( NPC_ID_IAN_DRAKE, arcemu.GOSSIP_EVENT_HELLO, elders_onHello )
  44. arcemu.RegisterUnitGossipEvent( NPC_ID_IAN_DRAKE, arcemu.GOSSIP_EVENT_SELECT, elders_onSelectOption )
  45. arcemu.RegisterUnitGossipEvent( NPC_ID_EDWARD_CAIN, arcemu.GOSSIP_EVENT_HELLO, elders_onHello )
  46. arcemu.RegisterUnitGossipEvent( NPC_ID_EDWARD_CAIN, arcemu.GOSSIP_EVENT_SELECT, elders_onSelectOption )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement