summaryrefslogblamecommitdiff
path: root/world/map/npc/034-1/ambushs.txt
blob: ff01993b1751859ac904cbe172a0cc5a58e3b71c (plain) (tree)






























































































                                                                                                         
// This file belongs to the wolvern hunting quest given by 033-1/birrod.txt
// Author: Jenalya
// TODO: add more ambushs all over the map

034-1.gat,118,59,0|script|#Ambush0Trigger|45,1,1,{
    set @Q_Barbarians_MASK, NIBBLE_0_MASK;
    set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
    set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
    if (@state != 4)
        end;
    if (rand(50) > wolvern_count) // TODO: eventally use different argument for rand
        end;
    set $@Ambush0VictimID, getcharid(3);
    if ($@Ambush0_Active != 0)
        end;
    set $@Ambush0_Active, 1;
    donpcevent "#Ambush0::OnAmbush";
    end;
}

034-1.gat,119,60,0|script|#Ambush0|45,{
end;

OnAmbush:
    attachrid($@Ambush0VictimID);
    set @wolvern_amount, 10;   // has to be same value as in birrod.txt
    set $@Ambush0_Spawn, 4 + rand(3);
    message strcharinfo(0), "An ambush!";
    areamonster "034-1.gat", 113, 55, 122, 63, "", 1089, $@Ambush0_Spawn, "#Ambush0::OnWolvernDeath";
    set $@Ambush0VictimID, 0;
    end;

OnWolvernDeath:
    set @MobID, 1089; // TODO: adapt

    set @Q_Barbarians_MASK, NIBBLE_0_MASK;
    set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
    set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
    if (@state == 4)
        set wolvern_count, wolvern_count + 1;

    set $@Ambush0_Spawn, $@Ambush0_Spawn - 1;
    if ($@Ambush0_Spawn == 0)
        set $@Ambush0_Active, 0;

    if (wolvern_count >= @wolvern_amount)
        message strcharinfo(0), "You've hunted down a lot of Wolverns. Maybe you should talk to Birrod?";
    end;
}

034-1.gat,94,91,0|script|#Ambush1Trigger|45,1,1,{
    set @Q_Barbarians_MASK, NIBBLE_0_MASK;
    set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
    set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
    if (@state != 4)
        end;
    if (rand(50) > wolvern_count)
        end;
    set $@Ambush1VictimID, getcharid(3);
    if ($@Ambush1_Active != 0)
        end;
    set $@Ambush1_Active, 1;
    donpcevent "#Ambush1::OnAmbush";
    end;
}

034-1.gat,94,92,0|script|#Ambush1|45,{
end;

OnAmbush:
    attachrid($@Ambush1VictimID);
    set @wolvern_amount, 10;   // has to be same value as in birrod.txt
    set $@Ambush1_Spawn, 4 + rand(3);
    message strcharinfo(0), "An ambush!";
    areamonster "034-1.gat", 91, 89, 98, 94, "", 1089, $@Ambush1_Spawn, "#Ambush1::OnWolvernDeath";
    set $@Ambush1VictimID, 0;
    end;

OnWolvernDeath:
    set @MobID, 1089; // TODO: adapt

    set @Q_Barbarians_MASK, NIBBLE_0_MASK;
    set @Q_Barbarians_SHIFT, NIBBLE_0_SHIFT;
    set @state, ((QUEST_Barbarians & @Q_Barbarians_MASK) >> @Q_Barbarians_SHIFT);
    if (@state == 4)
        set wolvern_count, wolvern_count + 1;

    set $@Ambush1_Spawn, $@Ambush1_Spawn - 1;
    if ($@Ambush1_Spawn == 0)
        set $@Ambush1_Active, 0;

    if (wolvern_count >= @wolvern_amount)
        message strcharinfo(0), "You've hunted down a lot of Wolverns. Maybe you should talk to Birrod?";
    end;
}