Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class 1 wiseman : citizen
- {
- parameter:
- string wiseman_challenge_1 = "wiseman_challenge_1.htm";
- string wiseman_challenge_2 = "wiseman_challenge_2.htm";
- string wiseman_challenge_3 = "wiseman_challenge_3.htm";
- string wiseman_challenge_4 = "wiseman_challenge_4.htm";
- string wiseman_challenge_5 = "wiseman_challenge_5.htm";
- handler:
- EventHandler CREATED()
- {
- myself::Shout( "All we have to decide is what to do with the time that is given us." );
- }
- EventHandler TALKED( talker )
- {
- if( myself.i_ai0 == 1 )
- {
- myself::Say( "bye");
- myself::Despawn();
- }
- myself::AddTimerEx( 1, 30 * 1000 );
- if( gg::Rand( 5 ) == 0 && myself.i_ai0 == 0 )
- {
- myself::ShowPage( talker, wiseman_challenge_1 );
- myself.i_ai0 = 1;
- }
- else if( gg::Rand( 5 ) == 1 && myself.i_ai0 == 0 )
- {
- myself::ShowPage( talker, wiseman_challenge_2 );
- myself.i_ai0 = 1;
- }
- else if( gg::Rand( 5 ) == 2 && myself.i_ai0 == 0 )
- {
- myself::ShowPage( talker, wiseman_challenge_3 );
- myself.i_ai0 = 1;
- }
- else if( gg::Rand( 5 ) == 3 && myself.i_ai0 == 0 )
- {
- myself::ShowPage( talker, wiseman_challenge_4 );
- myself.i_ai0 = 1;
- }
- else if( gg::Rand( 5 ) == 4 && myself.i_ai0 == 0 )
- {
- myself::ShowPage( talker, wiseman_challenge_5 );
- myself.i_ai0 = 1;
- }
- else if (myself.i_ai0 == 0 )
- {
- myself::ShowPage( talker, wiseman_challenge_5 );
- myself.i_ai0 = 1;
- }
- }
- EventHandler MENU_SELECTED( talker, ask, reply, fhtml0 )
- {
- target = talker;
- if ( ask == -1 )
- {
- if ( reply == 1 )
- {
- myself::Say( "Correct answer");
- if( gg::Rand( 10 ) < 2 )
- {
- myself::GiveItem1( target, 7863, 1 );
- }
- myself::Despawn();
- }
- if ( reply == 2 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 3 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 4 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 5 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- }
- if (ask == -2)
- {
- if ( reply == 1 )
- {
- myself::Say( "Correct answer");
- if( gg::Rand( 10 ) < 2 )
- {
- myself::GiveItem1( target, 7863, 1 );
- }
- myself::Despawn();
- }
- if ( reply == 2 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 3 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 4 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 5 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- }
- if (ask == -3)
- {
- if ( reply == 1 )
- {
- myself::Say( "Correct answer");
- if( gg::Rand( 10 ) < 2 )
- {
- myself::GiveItem1( target, 7863, 1 );
- }
- myself::Despawn();
- }
- if ( reply == 2 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 3 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 4 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 5 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- }
- if (ask == -4)
- {
- if ( reply == 1 )
- {
- myself::Say( "Correct answer");
- if( gg::Rand( 10 ) < 2 )
- {
- myself::GiveItem1( target, 7863, 1 );
- }
- myself::Despawn();
- }
- if ( reply == 2 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 3 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 4 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 5 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- }
- if (ask == -5)
- {
- if ( reply == 1 )
- {
- myself::Say( "Correct answer");
- if( gg::Rand( 10 ) < 2 )
- {
- myself::GiveItem1( target, 7863, 1 );
- }
- myself::Despawn();
- }
- if ( reply == 2 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 3 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 4 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- if ( reply == 5 )
- {
- myself::Say( "nope");
- myself::Despawn();
- }
- }
- }
- EventHandler SEE_CREATURE( creature )
- {
- myself::Say( "Who are there ?");
- if( myself.p_state != 3 && myself::GetLifeTime() > 7 )
- {
- if( myself::DistFromMe( creature ) > 200 )
- {
- myself::InstantTeleport( myself.sm, myself::FloatToInt( creature.x ),
- myself::FloatToInt( creature.y ),
- myself::FloatToInt( creature.z ) );
- if( myself::Skill_GetConsumeMP( TeleportEffect ) < myself.sm.mp &&
- myself::Skill_GetConsumeHP( TeleportEffect ) < myself.sm.hp &&
- myself::Skill_InReuseDelay( TeleportEffect ) == 0 )
- {
- myself::AddUseSkillDesire( myself.sm, TeleportEffect, 1, 1, 1000000 );
- }
- }
- }
- }
- EventHandler NO_DESIRE()
- {
- myself::AddMoveAroundDesire( 5, 5 );
- }
- EventHandler TIMER_FIRED_EX( timer_id )
- {
- if( timer_id == 1 )
- {
- myself::Say( "bye");
- myself::Despawn();
- }
- }
- EventHandler MY_DYING( target , last_attacker )
- {
- //
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement