summaryrefslogblamecommitdiff
path: root/npc/018-5-0/core.txt
blob: 978c73868d46d57a177e78b3f39c3e8294002a59 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                     
                                               











                                                                                                   
// TMW-2 Script
// Author:
//  Jesusalva
// Description:
//  Controls the swimming minigame. Basically, you lose 1% HP if lack total status.

018-5-0,0,0,0	script	#01850SwimmingCtrl	NPC_HIDDEN,{
    end;

OnLoop:
    if (getmap() != "018-5-0")
        end;
    if (ispcdead())
        end;
    // Sum everything - you can have 70 str instead of splitting in 35 str and 35 vit
    .@status=readparam2(bStr)+readparam2(bVit);
    .@reqst=.reqstr+.reqvit;
    debugmes "Got %d/%d (%d), heal %d", .@status,.@reqst,.@status-.@reqst,min(0, .@status-.@reqst);
    //percentheal min(0, .@status-.@reqst), 0;
    heal (min(0, .@status-.@reqst)*3), 0;
    addtimer(3000, "#01850SwimmingCtrl::OnLoop");
    end;

OnInit:
    .reqstr=35;
    .reqvit=35;
    end;
}