Function Survival

CDER

New member
Messages
41
Points
0
Github
CDER
Hi guys, I have a very big and expansive project.




First of all I'm Brazilian the script was not 100% translated, interpreted dubarma as

"durabilityweapon" and dubarmor as "durabilityarmor"

1-Doubts:
I do not know all the doc commands yet, so this is not quite complete function.


Code:
2-Npcs function:
I added npcs to the outside of the function, and I used the "callfunc" 
command in the npc to call the function, these npcs would be bed,
durability repairer, and in the future would initiate the same "callfunc"
 1 hunger, thirst.
Code:
3-Error !!!
When creating my menu npc, to view the statuses, only everything appears in 0,
as if the function had not responded.
Code:
4- Menu command
I used bindatcmd to when using the @ menu command, I would view your information.
And I used the * menu, and even created a labbel for him.
scriptlabbel:
menu1:
mes.@name $;
mes "[Hunger]:"+.@hunger;
month "[Headquarters]:"+.@headquarters;
mes "[Sleep]:"+.@sleep;
month "[DubArma]:"+.@dubarma;
mes "[DubArmor]:"+.@dubarmadura;
close;
end;

5-  function script

function    script    Sobrevivencia    {
getcharid(0);
    if (getcharid(0)){
    .@fome = 100;
    .@sede = 100;
    .@sono = 100;
    .@dubarma = 100;
    .@dubarmadura = 100;
    setd(".@fome", 100);
    setd(".@sede", 100);
    setd(".@sono", 100);
    setd(".@dubarma", 100);
    setd(".@dubarmadura", 100);
    getd(".@fome");
    getd(".@sede");
    getd(".@sono");
    getd(".dubarma");
    getd(".@dubarmadura");
    end;
    }
    else{
        if (.@fome <= 1){
        delchar(.@fome, 0);
        end;        
        }
    }
        if (.@sede <= 1){
        delchar(.@sede, 0);
        end;
        }
        if (.@sono <= 1){
        delchar(.@sono, 0);
        end;        
        }
        if (.@sono <= 31){
        sleep(30000);
        sleep2(30000);
        end;
        }
        if (.@dubarma <= 1){
       @breakweapon;
        end;
        }    
        if (.@dubarmadura <= 1){
        @breakarmor;
         end;
        }
        attachnpctimer("strcharinfo(0)")
        initnpctimer(strcharinfo(0));
OnTimer1080000:
.@fome = -1;
.@sede = -1;
.@sono = -4;
end;
}

 
Sorry but I have no idea what you are trying to do nor what this script is supposed to do.

 
None of this script makes any sense.

As you were told by me and many other people on the Hercules Discord, you need to learn the basics of NPC scripting.

 
Sorry but I have no idea what you are trying to do nor what this script is supposed to do.


It would be a system of hunger, thirst, sleep ... If it arrives in a value less than 1, of the following commands like, delchar, breakequip, it is very visible until .., 

in my case every 18 minutes, would consume -1 hunger, thirst and -4 sleep, the durability of arms would care in the future, ie instead of spending -1 with time, would be spent through attacks, I was told that I need to move in the sql, while others insist on saying that my function has no logic whatsoever, which is funny, even because I know of my failures ...

 
Last edited by a moderator:
Im just saying something like with would probably live off status icons or commands in chat box 

Could probably pull something nice off though

 
Back
Top